dib0 / elro_connects

The ELRO Connects uses a propriety protocol on the local network over UDP. This is the reversed engineered python implementation of the protocol.
MIT License
16 stars 7 forks source link

Send commands using CLI and/or mqtt #7

Closed depuits closed 2 years ago

depuits commented 3 years ago

It would be nice if there would be an option to send commands using the CLI or an mqtt message. This for example to change the device names or testing alarms.

For the CLI it could be something like

# Connect to controller and send mqtt messages 
elro connect -k HOSTNAME -i ID -m "mqtt://username:password@host.domain"

# Change device name using -a (action) flag
elro device -k HOSTNAME -i ID -d "Device name" -a CHANGE_NAME "new device name"

# Test device alarm
elro device -k HOSTNAME -i ID -d "Device name" -a TEST_ALARM

Another option would be to use mqtt messages using following topic

[base_topic]/elro/[device_name_or_id]/action

with a json object as message

{
    "action": "change_name",
    "newName": "new device name"
}

Using the CLI route it would probably be interesting to have a config file for the connection options so you don't have to repeat these for every action. This is something that's not required when using mqtt action messages.

hildensia commented 3 years ago

Good idea, I'll look into the protocol if that's possible

depuits commented 2 years ago

Are there any more action which are not possible after the last pull request was merged? Otherwise this issue can be closed.