[Enhancement] capability to connect to Athom Homey Pro
It would be super nice to have an connection between the NSPanelManager and Athom Homey Pro (NSPanel MQTT Manager <-- --> and the Athom Homey Pro MQTT-Hub app)
i think this is the "easiest" method of implementation because the MQTT Hub app broadcasts all devices to the MQTT broker) the app can be seen here @ https://homey.app/nl-nl/app/nl.hdg.mqtt/MQTT-Hub/
It uses the Homie Convention v3.0.1 (https://homieiot.github.io/specification/spec-core-v3_0_1/) and also a Home Assistant Discovery
You're already building a super nice product! Keep going!
after digging more in the code i think for implementing Homey you need this python library:
https://github.com/rkokkelk/python-athom-api
after digging more in the code i think for implementing Homey you need this python library:
https://github.com/rkokkelk/python-athom-api
Seems like a wrapper library for their web API, shouldn't be needed from what I understand from the link in your first post. Good reference for implementation of our own API though.
aah okay, i was confused because the home-assistant and openhab uses API key to connect and in both python files you make a websocket connection to set the values like this:
msg = {
"id": next_id,
"type": "call_service",
"domain": "light",
"service": "turn_on",
"service_data": {
"hs_color": [
color_hue,
color_saturation
],
"brightness_pct": light_level
},
"target": {
"entity_id": entity_name
}
}
send_message(json.dumps(msg))
but it is true, that you could get / set all settings for homey via only mqtt :-) 👍
for now a workaround is possible sinds version 1.0.4 but it needs some manual modifications.
First you have to add all of you lights/switches manually to the nspanelmanager_db.sqlite3 file. here is an example of the sql query you can execute:
insert into `web_light` (`can_color_temperature`, `can_dim`, `can_rgb`, `friendly_name`, `home_assistant_name`, `is_ceiling_light`, `openhab_control_mode`, `openhab_item_color_temp`, `openhab_item_dimmer`, `openhab_item_rgb`, `openhab_item_switch`, `openhab_name`, `room_id`, `room_view_position`, `type`) values ('1', '1', '1', 'Lamp', 'lamp', '1', 'dim', '1', '1', '1', 'switch', 'lamp', '1', '1', 'manual')
correctly change the column values according to the device capabilities your Homey Device has and to which room_id & room_view_position you want to add this device to.
after adding all the "Homey device" lights you want to control on the NSPanels you remember the id and the friendly_name.
After that you'll need "Advanced Flows in Homey Pro" and "MQTT Client" https://homey.app/en-nl/app/nl.scanno.mqtt/MQTT-Client/ App installed on your Homey Pro.
Then you can create a Advanced Flow something like this below. (remember this flow is only for one device! and just an example for a starting point )
change the parameters in the Cards according to your entity_id ( the id's from the table web_light) you also need to find the nspanel's MAC ADDRESS. and use that to filter the current Json key "mac_origin". (you could remove those cards as it is not really required, the same goes for the "method" key "set", which is not required.)
there is one issue here. the key "entity_ids" is an array. so if you have more NSPanel entities/devices on a panel you cannot check if value of "entity_ids" === "[1]" where 1 is the web_light table id.
you should do a more advanced check like if 1 is in array of entity_ids... but this part is only the example flow you can modify as needed
