Hi All,
I want to explore the use of a shelly device (in this particular case a 1PM) to use it as a BLE monitor.
The main goal is, when device within a certain RSSI level of the shelly, do something or set a certain room on that user.
That automation part is yet to come, and willing to sort out myself fist once this date is fed correctly into HA.
the current setup is that mosquito MQTT is installed on HA and MQTT plugin is running.
The shelly device is running the BLE script, and pushing this to HA/MQTT.
All is set so I am receiving the shelly data to HA.
The last part is to get that data into a sensor.
I’ve created a mqtt.yaml
to make the future devices where required, but I am not getting my head around how to parse the data correctly into a sensor.
I’m am not familiar with MQTT yet, but from what I’ve learned the past days is that there are topics.
In this case the topic where the data is sent to:
BLE-Tuin/events/rpc
The json formatted text that is received is as following:
{
"src": "shellypro1pm-30c6f78116f4",
"dst": "BLE-Tuin/events",
"method": "NotifyEvent",
"params": {
"ts": 1690899791.78,
"events": [
{
"component": "script:1",
"id": 1,
"event": "ble.scan_result",
"data": [
1,
"87:84:d9:06:8a:51",
-96,
"AgEGAwIBohQWAaIBIz9OVbmCsI4heQKizoZMHQ==",
""
],
"ts": 1690899791.78
}
]
}
}
Basically what my toughts are for now, is to make a sensor based on the mac-adress. in this case 87:84:d9:06:8a:51
and write the actual RSSI level to a entity. in this case -96
Is someone able to ramp me up how to:
- Create a proper sensor. the lucky guess from what I have learned is, that this is some part to go into
configuration.yaml
but on my end, I includedmqtt.yaml
so that is clear so far.
mqtt
sensor:
- name: "BLE-Tuin"
- How to parse the event data into the correct sensor every time.
I hope I am clear on my question, if not, let me know and I’ll do my best to provide the needed info
As far as it is usefull.
I’m running the 1.0.0-beta6 firmware on the 1PM