create node1 entity in home assistant
This commit is contained in:
parent
2548813231
commit
25caea841b
4 changed files with 99 additions and 41 deletions
33
README.md
33
README.md
|
|
@ -37,6 +37,13 @@ Weatherproof Enclosure: [weatherproof-cover-for-outdoor-sensors](https://shop.pi
|
|||
|
||||
_Note: I would not recommend buying from pimoroni from EU as shipping tax is huge!_
|
||||
|
||||
## Helpful links
|
||||
|
||||
- [pico mqtt Example](https://github.com/raspberrypi/pico-examples/blob/master/pico_w/wifi/mqtt/README)
|
||||
- [pico pinout](https://pico.pinout.xyz/)
|
||||
- [home assistant mqtt guide](https://www.home-assistant.io/integrations/mqtt/#testing-your-setup)
|
||||
- [home assistant device classes](https://www.home-assistant.io/integrations/sensor/#device-class)
|
||||
|
||||
## Dev
|
||||
|
||||
### Env Setup
|
||||
|
|
@ -124,3 +131,29 @@ Restarting the program:
|
|||
```shell
|
||||
(lldb) process plugin packet monitor reset run
|
||||
```
|
||||
|
||||
### Home assistant debugging
|
||||
|
||||
#### Subscribe to a topic
|
||||
|
||||
```shell
|
||||
$ TOPIC=zigbee2mqtt/0xa4c13848a46ea1cf; mosquitto_sub -h 192.168.1.11 -t $TOPIC -u homeassistant -P xxx
|
||||
```
|
||||
|
||||
#### Send message
|
||||
|
||||
Config example:
|
||||
|
||||
```shell
|
||||
$ mosquitto_pub -h 192.168.1.11 -P xxxxxxxx \
|
||||
-u homeassistant -t homeassistant/device/bws/node1_001/config \
|
||||
-f node1.json -r
|
||||
```
|
||||
|
||||
Payload example:
|
||||
|
||||
```shell
|
||||
$ mosquitto_pub -h 192.168.1.11 -P xxxxxxxx \
|
||||
-u homeassistant -t bws/node1/state \
|
||||
-f node1_payload_example.json
|
||||
```
|
||||
|
|
|
|||
58
node1.json
Normal file
58
node1.json
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"dev": {
|
||||
"ids": "bws_node1_001",
|
||||
"name": "Node1",
|
||||
"mf": "diy",
|
||||
"sw": "1.0",
|
||||
"hw": "1.0"
|
||||
},
|
||||
"cmps": {
|
||||
"node1_temp": {
|
||||
"p": "sensor",
|
||||
"device_class": "temperature",
|
||||
"unit_of_measurement": "°C",
|
||||
"value_template": "{{ value_json.temperature}}",
|
||||
"unique_id": "bws_node1_temp_001"
|
||||
},
|
||||
"node1_humidity": {
|
||||
"p": "sensor",
|
||||
"device_class": "humidity",
|
||||
"unit_of_measurement": "%",
|
||||
"value_template": "{{ value_json.humidity}}",
|
||||
"unique_id": "bws_node1_humidity_001"
|
||||
},
|
||||
"node1_pressure": {
|
||||
"p": "sensor",
|
||||
"device_class": "atmospheric_pressure",
|
||||
"unit_of_measurement": "hPa",
|
||||
"value_template": "{{ value_json.pressure}}",
|
||||
"unique_id": "bws_node1_pressure_001"
|
||||
},
|
||||
"node1_pm1": {
|
||||
"p": "sensor",
|
||||
"device_class": "pm1",
|
||||
"unit_of_measurement": "µg/m³",
|
||||
"value_template": "{{ value_json.pm1}}",
|
||||
"unique_id": "bws_node1_pm1_001"
|
||||
},
|
||||
"node1_pm25": {
|
||||
"p": "sensor",
|
||||
"device_class": "pm25",
|
||||
"unit_of_measurement": "µg/m³",
|
||||
"value_template": "{{ value_json.pm25}}",
|
||||
"unique_id": "bws_node1_pm25_001"
|
||||
},
|
||||
"node1_pm10": {
|
||||
"p": "sensor",
|
||||
"device_class": "pm10",
|
||||
"unit_of_measurement": "µg/m³",
|
||||
"value_template": "{{ value_json.pm10}}",
|
||||
"unique_id": "bws_node1_pm10_001"
|
||||
}
|
||||
},
|
||||
"o": {
|
||||
"name": "diy_pico_w"
|
||||
},
|
||||
"state_topic": "bws/node1/state",
|
||||
"qos": 1
|
||||
}
|
||||
8
node1_payload_example.json
Normal file
8
node1_payload_example.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"temperature": 15.2,
|
||||
"humidity": 58,
|
||||
"pressure": 945.5,
|
||||
"pm1": 7,
|
||||
"pm25": 7,
|
||||
"pm10": 7
|
||||
}
|
||||
41
notes.txt
41
notes.txt
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
## Helpful links
|
||||
- https://docs.circuitpython.org/projects/minimqtt/en/latest/examples.html
|
||||
- [how to use settings.toml](https://learn.adafruit.com/circuitpython-octoprint-controller-and-monitor/create-your-settings-toml-file)
|
||||
- [adafruit-circuitpython-esp32spi docs](https://docs.circuitpython.org/projects/esp32spi/en/latest/)
|
||||
- [pico pinout](https://pico.pinout.xyz/)
|
||||
- [home assistant mqtt guide](https://www.home-assistant.io/integrations/mqtt/#testing-your-setup)
|
||||
- [home assistant device classes](https://www.home-assistant.io/integrations/sensor/#device-class)
|
||||
|
||||
## Home assistant debugging
|
||||
|
||||
homeassistant/sensor/balcony_weather_station/test_bme_280
|
||||
homeassistant/sensor/balcony_weather_station/test_bme_280
|
||||
{
|
||||
"name": "BEM 280 Temperature",
|
||||
"device_class": "temperature",
|
||||
"unit_of_measurement": "°C",
|
||||
"value_template": "{{ value_json.temperature}}",
|
||||
"state_topic": "homeassistant/sensor/balcony_weather_station/test_bme_280/state",
|
||||
"unique_id": "balcony_weather_station_bme_280_test_temperature",
|
||||
"device": {
|
||||
"identifiers": "balcony_weather_station_001",
|
||||
"name": "Balcony Weather Station"
|
||||
}
|
||||
}
|
||||
|
||||
homeassistant/sensor/balcony_weather_station/test_bme_280/state
|
||||
{ "temperature": 23.20, "humidity": 50 }
|
||||
|
||||
{
|
||||
"name": "BEM 280 Humidity",
|
||||
"device_class": "humidity",
|
||||
"unit_of_measurement": "%",
|
||||
"value_template": "{{ value_json.humidity}}",
|
||||
"state_topic": "homeassistant/sensor/balcony_weather_station/test_bme_280/state",
|
||||
"unique_id": "balcony_weather_station_bme_280_test_humidity",
|
||||
"device": {
|
||||
"identifiers": "balcony_weather_station_001",
|
||||
"name": "Balcony Weather Station"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue