Page 1 of 1
Unable to control scene using json in HA Bridge
Posted: Saturday 30 June 2018 1:55
by foffen
Added a scene to HA bridge but it fals tesing, i have imported it as domotics device so it's autoconfigured and all other switches works fine but this one:
URL
RESULT
{
"status" : "ERR"
}
I have verified that it is the correct idx and if i simply try to substitute with another idx it works. Also, the scene works fine from within domoticz web interface.
When i test the switch in HA bridge i get error:
Request Error, Please look in your habridge log: error {"type":"6","address":"/lights/12","description":"Error on calling url to change device state","method_name":"/lights/12state"}
Domoticz is runing 4.9700 on a raspberry pi3 with razberry card and RFLINK. most sub components are fairly up to date.
I cannot wrap my head around why it wont bite on this scene alone.
Thanks
Re: Unable to control scene using json in HA Bridge
Posted: Saturday 30 June 2018 12:00
by waaren
What is the result if you enter this URL in your browser ?
Should it not be
http://10.10.10.31:8080/json.htm?type=c ... itchcmd=On
Re: Unable to control scene using json in HA Bridge
Posted: Monday 02 July 2018 15:25
by 1970sITman
I've got the same problem but before I had to rebuild my Pi completely and reinstall everyting, it used to work!
If i copy/paste the control line from Habridge into a browser, the scene/group command does NOT work but just by changing the index number to a single light switch , it works, both via Habridge and direct from a browser.
Is all that's usually necessary is to change the index number?
Re: Unable to control scene using json in HA Bridge
Posted: Monday 02 July 2018 15:39
by waaren
1970sITman wrote: ↑Monday 02 July 2018 15:25
I've got the same problem but before I had to rebuild my Pi completely and reinstall everyting, it used to work!
If i copy/paste the control line from Habridge into a browser, the scene/group command does NOT work but just by changing the index number to a single light switch , it works, both via Habridge and direct from a browser.
Is all that's usually necessary is to change the index number?
the json command to activate a scene is:
http://domoticzIP:domoticzPort/json.htm?type=command¶m=switchscene&idx=IDX&switchcmd=On
for single lights/ switch, the command is:
http://domoticzIP:domoticzPort/json.htm?type=command¶m=switchlight&idx=IDX&switchcmd=On
these are the type of JSON / API calls HABridge use to make something happen in domoticz.
Re: Unable to control scene using json in HA Bridge
Posted: Wednesday 04 July 2018 23:30
by 1970sITman
Excellent, Thanks. That's what was wrong. The Domoticz device 'auto-build' within HABridge is not creating the correct syntax.
It is putting ...................command¶m=switchlight&idx=12&switchcmd=On
as opposed to ...............command¶m=switchscene&idx=12&switchcmd=On
Once I edited the line in question, everything works.
Re: Unable to control scene using json in HA Bridge
Posted: Wednesday 04 July 2018 23:36
by waaren
1970sITman wrote: ↑Wednesday 04 July 2018 23:30
Excellent, Thanks. That's what was wrong. The Domoticz device 'auto-build' within HABridge is not creating the correct syntax.
It is putting ...................command¶m=switch
light&idx=12&switchcmd=On
as opposed to ...............command¶m=switch
scene&idx=12&switchcmd=On
Once I edited the line in question, everything works.
Good that it worked for you. In my version of the HABridge (5.2.1) the build command for scenes and groups generates the right JSON command. What version are you on ?
Re: Unable to control scene using json in HA Bridge
Posted: Monday 23 July 2018 21:00
by dornquast
I wanted to confirm this problem still exists.
Domoticz version 4.9747
HA Bridge 5.2.1
Clean install / setup - does not correctly handle Domoticz groups.
It builds URLs for switchs, not scenes or groups.
Manually editing the URL to use the word switchscene instead of switch works.
Also, take care to remove the extra space that appears in URL.