Is it possible to read the manual switch physical state using MQTT or HTTP API?

  • Hi,

    I just connected my first Shelly 2.5 and am using it to control two separate light zones in a large room. Configuration:

    - RELAY mode
    - POWER ON DEFAULT MODE: restore last
    - MANUAL SWITCH: edge

    The lights will operate primarily using the MANUAL switches. The purpose of the Shelly 2.5 is to force lights off in case the lights were left ON accidentally (e.g. midnight or over the weekend).


    My question: is it possible to read the state of the manual switches (ON or OFF) using the HTTP or MQTT APIs?

    I know I could change the POWER ON default mode to switch and MANUAL SWITCH to toggle to indirectly guess the switches state. I'm just wondering wheather the API provides this information is an easier, side-effects free, way.

    Thanks!

  • I found the answer myself and YES, it is possible.

    In case of the HTTP REST API:

    GET /status

    Code
    {...,
    "inputs":[
    {"input":1,"event":"","event_cnt":0},
    {"input":0,"event":"","event_cnt":0}
    ],
    ...}

    "input shows the current logical state of the input: 0=OFF and 1=ON. "