sensor.yaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. backendname: sensors
  2. description: sensor model für storing and retrieving sensor data
  3. models:
  4. - name: temperatur
  5. fields:
  6. - name: temperatur
  7. type: float
  8. mandatory: false
  9. collection: false
  10. - name: vstring
  11. type: string
  12. mandatory: false
  13. collection: false
  14. - name: vint
  15. type: int
  16. mandatory: false
  17. collection: false
  18. - name: vfloat
  19. type: float
  20. mandatory: false
  21. collection: false
  22. - name: vtime
  23. type: time
  24. mandatory: false
  25. collection: false
  26. - name: vbool
  27. type: bool
  28. mandatory: false
  29. collection: false
  30. - name: source
  31. type: string
  32. mandatory: false
  33. collection: false
  34. datasources:
  35. - name: temp_kueche
  36. type: mqtt
  37. destinations:
  38. - $model.temperatur
  39. - mqtt_sensors_temperatur
  40. rule: tasmota_ds18b20
  41. config:
  42. broker: 127.0.0.1:1883
  43. topic: tele/tasmota_63E6F8/SENSOR
  44. qos: 0
  45. payload: application/json
  46. username: temp
  47. password: temp
  48. addTopicAsAttribute: topic
  49. - name: temp_arbeit
  50. type: mqtt
  51. destinations:
  52. - mqtt_hm_output
  53. rule: tasmota_ds18b20_hm
  54. config:
  55. broker: 192.168.178.12:1883
  56. topic: tele/tasmota_63E6F8/SENSOR
  57. qos: 0
  58. payload: application/json
  59. username: temp
  60. password: temp
  61. addTopicAsAttribute: topic
  62. - name: temp_simple_text
  63. type: mqtt
  64. destinations:
  65. - $model.temperatur
  66. config:
  67. broker: 127.0.0.1:1883
  68. topic: stat/temperatur/simple/string
  69. payload: application/x.simple
  70. username: temp
  71. password: temp
  72. addTopicAsAttribute: topic
  73. simpleValueAttribute: vstring
  74. simpleValueAttributeType: string
  75. - name: temp_simple_int
  76. type: mqtt
  77. destinations:
  78. - $model.temperatur
  79. config:
  80. broker: 127.0.0.1:1883
  81. topic: stat/temperatur/simple/int
  82. payload: application/x.simple
  83. username: temp
  84. password: temp
  85. addTopicAsAttribute: topic
  86. simpleValueAttribute: vint
  87. simpleValueAttributeType: int
  88. - name: temp_simple_float
  89. type: mqtt
  90. destinations:
  91. - $model.temperatur
  92. config:
  93. broker: 127.0.0.1:1883
  94. topic: stat/temperatur/simple/float
  95. payload: application/x.simple
  96. username: temp
  97. password: temp
  98. addTopicAsAttribute: topic
  99. simpleValueAttribute: vfloat
  100. simpleValueAttributeType: float
  101. - name: temp_simple_time
  102. type: mqtt
  103. destinations:
  104. - $model.temperatur
  105. config:
  106. broker: 127.0.0.1:1883
  107. topic: stat/temperatur/simple/time
  108. payload: application/x.simple
  109. username: temp
  110. password: temp
  111. addTopicAsAttribute: topic
  112. simpleValueAttribute: vtime
  113. simpleValueAttributeType: time
  114. - name: temp_simple_bool
  115. type: mqtt
  116. destinations:
  117. - $model.temperatur
  118. config:
  119. broker: 127.0.0.1:1883
  120. topic: stat/temperatur/simple/bool
  121. payload: application/x.simple
  122. username: temp
  123. password: temp
  124. addTopicAsAttribute: topic
  125. simpleValueAttribute: vbool
  126. simpleValueAttributeType: bool
  127. rules:
  128. - name: tasmota_ds18b20
  129. description: transforming the tasmota json structure of the DS18B20 into my simple structure
  130. transform:
  131. - operation: shift
  132. spec:
  133. Temperature: DS18B20.Temperature
  134. TempUnit: TempUnit
  135. Datetime: Time
  136. Timestamp: Time
  137. Msg: $
  138. - operation: timestamp
  139. spec:
  140. Timestamp: {
  141. inputFormat: 2006-01-02T15:04:05,
  142. outputFormat: $unixext
  143. }
  144. - name: hm_temp_simple
  145. description: handle homematic temperatur rightly
  146. transform:
  147. - operation: shift
  148. spec:
  149. Temperature: val
  150. Timestamp: ts
  151. Datetime: ts
  152. - operation: default
  153. spec:
  154. TempUnit: C
  155. - operation: timestamp
  156. spec:
  157. Datetime: {
  158. inputFormat: $unixext,
  159. outputFormat: 2006-01-02T15:04:05-0700
  160. }
  161. - name: tasmota_ds18b20_hm
  162. description: transforming the tasmota json structure of the DS18B20 into hm basic structure
  163. transform:
  164. - operation: shift
  165. spec:
  166. val: DS18B20.Temperature
  167. ts: Time
  168. - operation: timestamp
  169. spec:
  170. Timestamp: {
  171. inputFormat: 2006-01-02T15:04:05,
  172. outputFormat: $unixext
  173. }
  174. destinations:
  175. - name: mqtt_sensors_temperatur
  176. type: mqtt
  177. config:
  178. broker: 127.0.0.1:1883
  179. topic: stat/temperatur
  180. qos: 1
  181. payload: application/json
  182. username: temp
  183. password: temp
  184. - name: mqtt_hm_output
  185. type: mqtt
  186. config:
  187. broker: 192.168.178.12:1883
  188. topic: hm/set/TempArbeit
  189. qos: 0
  190. payload: application/json
  191. username: temp
  192. password: temp