matsahm Posted February 18, 2017 Share Posted February 18, 2017 Hello, i have an idea. But I'm not smart enough to do this. Can someone help? I control my lamps with fhem. Can I now control fhem with Alfred? I can do it now with keywords and a bash-script: curl -k https://username:password@fhem:8083/fhem?XHR=1&cmd=set%20lamp%20toggle But i have to do this for every lamp. Can not read all devices from fhem? I can download a JSON-File with all lamps with this url: https://username:password@fhem:8083/fhem?cmd=jsonlist2 TYPE=FS20&XHR=1 How can I automate this now? Link to comment
deanishe Posted February 19, 2017 Share Posted February 19, 2017 In theory, you can read the JSON list of devices, then send a command to each device in the list. That shouldn't be very difficult to do in terms of coding, but you'll have to provide more information first, in particular how you expect the workflow to work and the JSON list of devices. Link to comment
matsahm Posted February 26, 2017 Author Share Posted February 26, 2017 Here is my workflow (see the attachments). This works good. But I have to maintain the list of devices by hand. I can get all the data in JSON format from fhem. Can i use this, to generate the list-element automatically? I hope, you know what i mean... Link to comment
deanishe Posted February 26, 2017 Share Posted February 26, 2017 3 hours ago, matsahm said: Can i use this, to generate the list-element automatically? Yes. But as said, you will have to provide a sample of the JSON if you want any concrete assistance. Link to comment
matsahm Posted February 26, 2017 Author Share Posted February 26, 2017 Sorry, here: { "ResultSet": { "Results": { "00": "10", "ATTRIBUTES": { "IODev": "CUL433", "group": "Beleuchtung", "room": "Wohnzimmer", "sortby": "01", "yaf_1": "id=3,fhemname=Lampe,y_pos=223,x_pos=546,name=iteasylamp," }, "CFGFN": "/opt/fhem/FHEM/Wohnzimmer.cfg", "CODE": { "1": "000fffff01" }, "DEF": "000FFFFF01 01 10", "IODev": "CUL433", "NAME": "Lampe", "NR": "62", "READINGS": { "protocol": { "TIME": "2015-03-27 19:11:45", "VAL": "V1" }, "state": { "TIME": "2015-10-13 07:30:00", "VAL": "off" } }, "STATE": "off", "TYPE": "IT", "XMIT": "000fffff01", "XMITdimdown": "00", "XMITdimup": "00", "XMITon": "01" } } } Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now