Not getting output of homeautomation code(on and off light)


i have writen this code in it but it still shows no code wriyeen please type ur code . and shows error there , tried everything to fix this but nothing is fixing it , may be there is problem in the link . please reply asap i have also mailed it you .
thank you ’

Hi @dhruvg0059,
Can you please share your code?

Bolt IoT Platform ON OFF

whenever i am sending the code it automatically converts the whole code into Bolt Iot Platform ON OFF, so i have shared a screenshot of it .

Did you saved your code before running?
Also can you please share the screenshot of your error?

Try to do the following steps that may resolve your issue- the file in .html format.
2.After saving the file go to products section and click on deploy confriguation.
3.Make sure you have passed the same value in digitalWrite() function as the first parameter.

Also can you please share the screenshot of your error?

@dhruvg0059 are you running this code inside the Bolt cloud environment? If not, then replace {{ApiKey}} with your actual API key and {{Name}} with your actual device ID. You may find your API key here.

Do let me know if you need any other help.

okay will let you know if i still face this issue

thank you for your response

yess i do saved it before running , shared with you

i have added api key and name of the product now i am getting this error this is only happening in this project, kindly resolve this , its been 2 days and still stuck in this .

thank you for ur reply

and i want to know , that in the (name) section we need to add the name of the product .
that i have used in in adding the product

@dhruvg0059 In the {{Name}} section put the device id that you can find here. Also, please share your updated code.(Hide the API key)

okay thank you so much for the correction sir ,
now i think the code should work properly .

again getting the same error , error 404 , device not found,althoght the led works fine i have tested it in the java script code .
but in html it showing the same issue .

@dhruvg0059 remove {{ }} in API key and Device ID.
For eg:setKey('abcd-1234-5555','BOLT78484843')
Let me know if it doesn’t work.

thank you now the code iis working properly , i have got the on and off buttons in the output , and may i know what was the exact problem in this .

The reason was:
setKey('{{ApiKey}}','{{Name}}'); should have been auto-populated with the API key and Device ID by the Bolt Cloud, but for some reason, it was not. So we manually entered the API key and device id.