Unable to control scene using json in HA Bridge

Post Reply
foffen
Posts: 3
Joined: Tuesday 13 September 2016 19:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Unable to control scene using json in HA Bridge

Post by foffen » Saturday 30 June 2018 1:55

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

User avatar
waaren
Posts: 1239
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Unable to control scene using json in HA Bridge

Post by waaren » Saturday 30 June 2018 12:00

foffen wrote:
Saturday 30 June 2018 1:55
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
http://10.10.10.31:8080/json.htm?type=c ... itchcmd=On
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
Last edited by waaren on Monday 02 July 2018 15:43, edited 1 time in total.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

1970sITman
Posts: 10
Joined: Sunday 02 February 2014 15:10
Target OS: Raspberry Pi
Domoticz version:
Location: NW London, UK
Contact:

Re: Unable to control scene using json in HA Bridge

Post by 1970sITman » 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?
4 pi(master+RFXtrx433 and 3 slaves+PiFace)
HE, BBSB, Lightwave, Micromark, Retrotouch & LIVOLO sockets, door switches, PIRs & Dimmers
EVE on iPad for Voice
Weather sensors
OWL CM160
eQ-3 MAX! Heating Controls (10 therms, 8 valves, 2 relays)

User avatar
waaren
Posts: 1239
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Unable to control scene using json in HA Bridge

Post by waaren » Monday 02 July 2018 15:39

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&param=switchscene&idx=IDX&switchcmd=On

for single lights/ switch, the command is:

http://domoticzIP:domoticzPort/json.htm?type=command&param=switchlight&idx=IDX&switchcmd=On

these are the type of JSON / API calls HABridge use to make something happen in domoticz.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

1970sITman
Posts: 10
Joined: Sunday 02 February 2014 15:10
Target OS: Raspberry Pi
Domoticz version:
Location: NW London, UK
Contact:

Re: Unable to control scene using json in HA Bridge

Post by 1970sITman » 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&param=switchlight&idx=12&switchcmd=On
as opposed to ...............command&param=switchscene&idx=12&switchcmd=On

Once I edited the line in question, everything works.
4 pi(master+RFXtrx433 and 3 slaves+PiFace)
HE, BBSB, Lightwave, Micromark, Retrotouch & LIVOLO sockets, door switches, PIRs & Dimmers
EVE on iPad for Voice
Weather sensors
OWL CM160
eQ-3 MAX! Heating Controls (10 therms, 8 valves, 2 relays)

User avatar
waaren
Posts: 1239
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Unable to control scene using json in HA Bridge

Post by waaren » Wednesday 04 July 2018 23:36

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&param=switchlight&idx=12&switchcmd=On
as opposed to ...............command&param=switchscene&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 ?
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

dornquast
Posts: 1
Joined: Monday 23 July 2018 20:52
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Unable to control scene using json in HA Bridge

Post by dornquast » Monday 23 July 2018 21:00

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests