Jump to content

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...