Hello,
I would like to ask you for your help. I also have a problem adding a sensor from TTN.
The sensor will not appear to me in new entities at all.
I enclose my code below. I already have more other sensors there, so I prefer to put everything here to see if I have a writing error somewhere.
# Integrace TTN sítě
thethingsnetwork:
app_id: gpstrackermoko
access_key: mykey
# Všechny ručně přidaný senzory
sensor:
- platform: mqtt
state_topic: "rtl_433/9b13b3f4-rtl433/devices/TS-FT002/156/depth_cm"
unit_of_measurement: "cm"
name: "hladinomer_studna"
icon: "hass:water"
- platform: template
sensors:
vyska_hladiny_studna:
value_template: "{{ 1050 - states('sensor.hladinomer_studna') | int }}"
friendly_name: "Výška hladiny"
unit_of_measurement: "cm"
- platform: template
sensors:
objem_vody_studna:
value_template: "{{ (states('sensor.vyska_hladiny_studna') | float * 7.853) | round(0) }}"
friendly_name: "Objem vody"
unit_of_measurement: "l"
- platform: template
sensors:
zustatek_vody_studna:
value_template: "{{ (states('sensor.vyska_hladiny_studna') | float * 100) / 400 | round(0) }}"
friendly_name: "Zůstatek vody"
unit_of_measurement: "%"
- platform: thethingsnetwork
device_id: gpstrackermoko
values:
latitude: "°"
longitude: "°"
and I see this in Swagger
[
{
"battery": null,
"current_pkt": 1,
"device_id": "gpstrackermoko",
"latitude": 49.24961751302083,
"longitude": 16.674969482421876,
"raw": "AgHRl5lF8Q/NRA==",
"sensor": "MOKO LW001-BG",
"speed": null,
"time": "2021-04-23T13:36:28.402917556Z",
"xdir": null,
"ydir": null
},
{
"battery": "ok",
"current_pkt": 2,
"device_id": "gpstrackermoko",
"latitude": null,
"longitude": null,
"raw": "AgIA7FG4PeW5Qv8=",
"sensor": "MOKO LW001-BG",
"speed": 0.16668000662326812,
"time": "2021-04-23T13:36:31.36482964Z",
"xdir": 475.89,
"ydir": 653.46
},
{
"battery": null,
"current_pkt": 1,
"device_id": "gpstrackermoko",
"latitude": 49.2495849609375,
"longitude": 16.6749755859375,
"raw": "AgHNl5lF9A/NRA==",
"sensor": "MOKO LW001-BG",
"speed": null,
"time": "2021-04-23T13:41:27.215384511Z",
"xdir": null,
"ydir": null
},
{
"battery": "ok",
"current_pkt": 2,
"device_id": "gpstrackermoko",
"latitude": null,
"longitude": null,
"raw": "AgIAzczMPee5Ov8=",
"sensor": "MOKO LW001-BG",
"speed": 0.18520000275969506,
"time": "2021-04-23T13:41:30.66551637Z",
"xdir": 475.91,
"ydir": 653.38
},
{
"battery": "ok",
"current_pkt": 2,
"device_id": "gpstrackermoko",
"latitude": null,
"longitude": null,
"raw": "AgIAmpkZPoTe7vA=",
"sensor": "MOKO LW001-BG",
"speed": 0.2778000110387802,
"time": "2021-04-23T13:46:30.610062735Z",
"xdir": 569.64,
"ydir": 616.78
},
{
"battery": null,
"current_pkt": 1,
"device_id": "gpstrackermoko",
"latitude": 49.25804850260417,
"longitude": 16.681817626953126,
"raw": "AgHdm5lFFx3NRA==",
"sensor": "MOKO LW001-BG",
"speed": null,
"time": "2021-04-23T14:01:26.922208561Z",
"xdir": null,
"ydir": null
},
{
"battery": "ok",
"current_pkt": 2,
"device_id": "gpstrackermoko",
"latitude": null,
"longitude": null,
"raw": "AgIAZmYmP9Agaf4=",
"sensor": "MOKO LW001-BG",
"speed": 1.2037999558448793,
"time": "2021-04-23T14:01:30.373975185Z",
"xdir": 84,
"ydir": 651.29
}
]