Eintrag

HA-Bridge Setup

HA-Bridge Setup

workaround for Alexa & Fibaro virtual devices

HA-Bridge

This will simulate a Philips Hue v1, so all devices will show up as lamps

install from https://github.com/bwssytems/ha-bridge

  • install java
    1
    
    apt install default-jre 
    
  • follow install and setup from github
  • if pihole is installed at port 80, switch that to 8080

after install and adding lamps, actions need to be changed based on type of device

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Invert
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setValue&arg1=<VALUE>
ON / OFF

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOn
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOff

Rollos
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setValue&arg1=<VALUE>
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setAjar
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=stop

Fibaro RGB-Module
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOff
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOn
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setColor&arg1=<VALUE>&arg2=<VALUE>&arg3=<VALUE>&arg4=<VALUE>
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=startProgram&arg1=<PROGRAM ID>

Virtual module
ID = device ID
arg1 = button ID
arg2 = slider value (only for slider)
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=pressButton&arg1=<BUTTON ID>
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setSlider&arg1=<SLIDER ID>&arg2=<VALUE>

Scenes
http://<LOGIN>:<PASS>@<IP>/api/sceneControl?id=<SCENE ID>&action=start
http://<LOGIN>:<PASS>@<IP>/api/sceneControl?id=<SCENE ID>&action=stop

Danfoss Living Connect / Devolo
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setTargetLevel&arg1=<TEMP VALUE>
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setTime&arg1=<TIME VALUE>

Notifications
ID = Device (Iphone, e-mail et cetera)
arg1 = Notification template
http://<LOGIN>:<PASS>@<IP>/api/callActiondeviceID=9&name=sendDefinedPushNotification&arg1=1

Panel “Energy”
http://<LOGIN>:<PASS>@<IP>/api/energy/now-3600/now/single/devices/power/58
  • to get the correct ID for a virtual device button on and off arg check the api config through devices i.e.
    1
    2
    
    http://...../api/devices/<deviceID> i.e.
    {"id":832,"name":"Tasmota-Radio-SZ","roomID":8,"type":"virtual_device","visible":true,"enabled":true,"properties":{"categories":["other"],"deviceIcon":1002,"ip":"","port":0,"categories":"[\"other\"]","currentIcon":"0","log":"","logTemp":"","mainLoop":"local device    = fibaro:getSelfId()\nlocal ipaddress = \"192.168.1.49\"\nlocal port \t\t= 80\n\n\ns = Net.FHttp(ipaddress, port)\nr = s:GET(\"/cm?cmnd=Status\")\n\nif r ~= nil and r ~= \"\" then\n  \tjS = json.decode(r)\n   \tif jS.Status.Power == 0 then\n   \t\tfibaro:call(device,\"setProperty\",\"ui.status.value\", \"Plug Off\")\n    \tfibaro:debug(\"Plug is off: \"..device)\n   \telseif jS.Status.Power == 1 then\n  \t\tfibaro:call(device,\"setProperty\",\"ui.status.value\", \"Plug On\")\n   \t\tfibaro:debug(\"Plug is on: \"..device)\n\tend\nelse\n  fibaro:debug(\"plug appears to be offline\")\n  fibaro:call(device,\"setProperty\",\"ui.status.value\", \"OFFLINE\")\nend\n\nfibaro:sleep(1000)\n\n","ui.status.value":"Plug On","visible":"true","rows":[{"type":"button","elements":[{"id":1,"lua":true,"waitForResponse":false,"caption":"ON","name":"btnon","empty":false,"msg":"local device    = fibaro:getSelfId()\nlocal ipaddress = \"192.168.1.49\"\nlocal port \t\t= 80\n\ns = Net.FHttp(ipaddress, port)\nr = s:GET(\"/cm?cmnd=Power%20On\")\n","buttonIcon":0,"favourite":false,"main":false},{"id":2,"lua":true,"waitForResponse":false,"caption":"OFF","name":"btnoff","empty":false,"msg":"local device    = fibaro:getSelfId()\nlocal ipaddress = \"192.168.1.49\"\nlocal port \t\t= 80\n\n\ns = Net.FHttp(ipaddress, port)\nr = s:GET(\"/cm?cmnd=Power%20Off\")","buttonIcon":0,"favourite":false,"main":false}]},{"type":"label","elements":[{"id":3,"lua":false,"waitForResponse":false,"caption":"","name":"status","favourite":true,"main":true}]}]},"actions":{"pressButton":1,"setSlider":2},"created":1730449633,"modified":1730449633,"sortOrder":132}
    

    here button btnon has id:1 and btnoff has id:2

Detect from Alexa with echo dot 3

upnp is not necessary on the router, but you need to reconfigure ha-bridge

  • Bridge Control / Update Security Settings / Use Link Button TRUE
  • set ‘Unique ID to use 9 Octets (Renumber after saving this setting)’ to true
  • Now launch Alexa, search for Hue v1 and press LINK on HA-Bridge (under Brdige Devices)

For troubleshooting activate UPNP Tracing and

1
tail -f /var/log/syslog
Dieser Eintrag ist vom Autor unter CC BY 4.0 lizensiert.