Wenar

Olimex-poe sprawdzanie stanu przekaznika po I2C

Dec 10th, 2021 (edited)
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.36 KB | None | 0 0
  1. esphome:
  2. name: olimex-status
  3. platform: ESP32
  4. board: esp32-poe-iso
  5.  
  6. # Enable logging
  7. logger:
  8.  
  9. # Enable Home Assistant API
  10. api:
  11.  
  12. ota:
  13. password: "123456789123456789"
  14.  
  15. ethernet:
  16. type: LAN8720
  17. mdc_pin: GPIO23
  18. mdio_pin: GPIO18
  19. clk_mode: GPIO17_OUT
  20. phy_addr: 0
  21. power_pin: GPIO12
  22. manual_ip:
  23. static_ip: 192.168.1.20
  24. gateway: 192.168.1.1
  25. subnet: 255.0.0.0
  26.  
  27. i2c:
  28. sda: 13
  29. scl: 16
  30. scan: True
  31. id: bus_a
  32.  
  33. mcp23017:
  34. - id: 'mcp23017_hub'
  35. address: 0x27
  36. - id: 'mcp23017_hub1'
  37. address: 0x26
  38. - id: 'mcp23017_hub2'
  39. address: 0x25
  40.  
  41.  
  42.  
  43. binary_sensor:
  44. # HUB 1
  45. # H1-1
  46. - platform: gpio
  47. pin:
  48. mcp23xxx: mcp23017_hub
  49. number: 0
  50. mode: INPUT_PULLUP
  51. inverted: True
  52. name: "Status 1-d1"
  53. device_class: light
  54. # H1-2
  55. - platform: gpio
  56. pin:
  57. mcp23xxx: mcp23017_hub
  58. number: 1
  59. mode: INPUT_PULLUP
  60. inverted: True
  61. name: "Status 1-d2"
  62. device_class: light
  63. # H1-3
  64. - platform: gpio
  65. pin:
  66. mcp23xxx: mcp23017_hub
  67. number: 2
  68. mode: INPUT_PULLUP
  69. inverted: True
  70. name: "Status 1-d3"
  71. device_class: light
  72. # H1-4
  73. - platform: gpio
  74. pin:
  75. mcp23xxx: mcp23017_hub
  76. number: 3
  77. mode: INPUT_PULLUP
  78. inverted: True
  79. name: "Status 1-d4"
  80. device_class: light
  81. # H1-5
  82. - platform: gpio
  83. pin:
  84. mcp23xxx: mcp23017_hub
  85. number: 4
  86. mode: INPUT_PULLUP
  87. inverted: True
  88. name: "Status 1-d5"
  89. device_class: light
  90. # H1-6
  91. - platform: gpio
  92. pin:
  93. mcp23xxx: mcp23017_hub
  94. number: 5
  95. mode: INPUT_PULLUP
  96. inverted: True
  97. name: "Status 1-d6"
  98. device_class: light
  99. # H1-7
  100. - platform: gpio
  101. pin:
  102. mcp23xxx: mcp23017_hub
  103. number: 6
  104. mode: INPUT_PULLUP
  105. inverted: True
  106. name: "Status 1-d7"
  107. device_class: light
  108. # H1-8
  109. - platform: gpio
  110. pin:
  111. mcp23xxx: mcp23017_hub
  112. number: 7
  113. mode: INPUT_PULLUP
  114. inverted: True
  115. name: "Status 1-d8"
  116. device_class: light
  117. # H1-9
  118. - platform: gpio
  119. pin:
  120. mcp23xxx: mcp23017_hub
  121. number: 8
  122. mode: INPUT_PULLUP
  123. inverted: True
  124. name: "Status 1-d9"
  125. device_class: light
  126. # H1-10
  127. - platform: gpio
  128. pin:
  129. mcp23xxx: mcp23017_hub
  130. number: 9
  131. mode: INPUT_PULLUP
  132. inverted: True
  133. name: "Status 1-d10"
  134. device_class: light
  135. # H1-11
  136. - platform: gpio
  137. pin:
  138. mcp23xxx: mcp23017_hub
  139. number: 10
  140. mode: INPUT_PULLUP
  141. inverted: True
  142. name: "Status 1-d11"
  143. device_class: light
  144. # H1-12
  145. - platform: gpio
  146. pin:
  147. mcp23xxx: mcp23017_hub
  148. number: 11
  149. mode: INPUT_PULLUP
  150. inverted: True
  151. name: "Status 1-d12"
  152. device_class: light
  153. # H1-13
  154. - platform: gpio
  155. pin:
  156. mcp23xxx: mcp23017_hub
  157. number: 12
  158. mode: INPUT_PULLUP
  159. inverted: True
  160. name: "Status 1-d13"
  161. device_class: light
  162. # H1-14
  163. - platform: gpio
  164. pin:
  165. mcp23xxx: mcp23017_hub
  166. number: 13
  167. mode: INPUT_PULLUP
  168. inverted: True
  169. name: "Status 1-d14"
  170. device_class: light
  171. # H1-15
  172. - platform: gpio
  173. pin:
  174. mcp23xxx: mcp23017_hub
  175. number: 14
  176. mode: INPUT_PULLUP
  177. inverted: True
  178. name: "Status 1-d15"
  179. device_class: light
  180. # H1-16
  181. - platform: gpio
  182. pin:
  183. mcp23xxx: mcp23017_hub
  184. number: 15
  185. mode: INPUT_PULLUP
  186. inverted: True
  187. name: "Status 1-d16"
  188. device_class: light
  189.  
  190. #
  191. # HUB 2
  192. # H2-1
  193. - platform: gpio
  194. pin:
  195. mcp23xxx: mcp23017_hub1
  196. number: 0
  197. mode: INPUT_PULLUP
  198. inverted: True
  199. name: "Status 2-d1"
  200. device_class: light
  201. # H2-2
  202. - platform: gpio
  203. pin:
  204. mcp23xxx: mcp23017_hub1
  205. number: 1
  206. mode: INPUT_PULLUP
  207. inverted: True
  208. name: "Status 2-d2"
  209. device_class: light
  210. # H2-3
  211. - platform: gpio
  212. pin:
  213. mcp23xxx: mcp23017_hub1
  214. number: 2
  215. mode: INPUT_PULLUP
  216. inverted: True
  217. name: "Status 2-d3"
  218. device_class: light
  219. # H2-4
  220. - platform: gpio
  221. pin:
  222. mcp23xxx: mcp23017_hub1
  223. number: 3
  224. mode: INPUT_PULLUP
  225. inverted: True
  226. name: "Status 2-d4"
  227. device_class: light
  228. # H2-5
  229. - platform: gpio
  230. pin:
  231. mcp23xxx: mcp23017_hub1
  232. number: 4
  233. mode: INPUT_PULLUP
  234. inverted: True
  235. name: "Status 2-d5"
  236. device_class: light
  237. # H2-6
  238. - platform: gpio
  239. pin:
  240. mcp23xxx: mcp23017_hub1
  241. number: 5
  242. mode: INPUT_PULLUP
  243. inverted: True
  244. name: "Status 2-d6"
  245. device_class: light
  246. # H2-7
  247. - platform: gpio
  248. pin:
  249. mcp23xxx: mcp23017_hub1
  250. number: 6
  251. mode: INPUT_PULLUP
  252. inverted: True
  253. name: "Status 2-d7"
  254. device_class: light
  255. # H2-8
  256. - platform: gpio
  257. pin:
  258. mcp23xxx: mcp23017_hub1
  259. number: 7
  260. mode: INPUT_PULLUP
  261. inverted: True
  262. name: "Status 2-d8"
  263. device_class: light
  264. # H2-9
  265. - platform: gpio
  266. pin:
  267. mcp23xxx: mcp23017_hub1
  268. number: 8
  269. mode: INPUT_PULLUP
  270. inverted: True
  271. name: "Status 2-d9"
  272. device_class: light
  273. # H2-10
  274. - platform: gpio
  275. pin:
  276. mcp23xxx: mcp23017_hub1
  277. number: 9
  278. mode: INPUT_PULLUP
  279. inverted: True
  280. name: "Status 2-d10"
  281. device_class: light
  282. # H2-11
  283. - platform: gpio
  284. pin:
  285. mcp23xxx: mcp23017_hub1
  286. number: 10
  287. mode: INPUT_PULLUP
  288. inverted: True
  289. name: "Status 2-d11"
  290. device_class: light
  291. # H2-12
  292. - platform: gpio
  293. pin:
  294. mcp23xxx: mcp23017_hub1
  295. number: 11
  296. mode: INPUT_PULLUP
  297. inverted: True
  298. name: "Status 2-d12"
  299. device_class: light
  300. # H2-13
  301. - platform: gpio
  302. pin:
  303. mcp23xxx: mcp23017_hub1
  304. number: 12
  305. mode: INPUT_PULLUP
  306. inverted: True
  307. name: "Status 2-d13"
  308. device_class: light
  309. # H2-14
  310. - platform: gpio
  311. pin:
  312. mcp23xxx: mcp23017_hub1
  313. number: 13
  314. mode: INPUT_PULLUP
  315. inverted: True
  316. name: "Status 2-d14"
  317. device_class: light
  318. # H2-15
  319. - platform: gpio
  320. pin:
  321. mcp23xxx: mcp23017_hub1
  322. number: 14
  323. mode: INPUT_PULLUP
  324. inverted: True
  325. name: "Status 2-d15"
  326. device_class: light
  327. # H2-16
  328. - platform: gpio
  329. pin:
  330. mcp23xxx: mcp23017_hub1
  331. number: 15
  332. mode: INPUT_PULLUP
  333. inverted: True
  334. name: "Status 2-d16"
  335. device_class: light
  336. # HUB 1
  337. # H3-1
  338. - platform: gpio
  339. pin:
  340. mcp23xxx: mcp23017_hub2
  341. number: 0
  342. mode: INPUT_PULLUP
  343. inverted: True
  344. name: "Status 1-d1"
  345. device_class: light
  346. # H3-2
  347. - platform: gpio
  348. pin:
  349. mcp23xxx: mcp23017_hub2
  350. number: 1
  351. mode: INPUT_PULLUP
  352. inverted: True
  353. name: "Status 1-d2"
  354. device_class: light
  355. # H3-3
  356. - platform: gpio
  357. pin:
  358. mcp23xxx: mcp23017_hub2
  359. number: 2
  360. mode: INPUT_PULLUP
  361. inverted: True
  362. name: "Status 1-d3"
  363. device_class: light
  364. # H3-4
  365. - platform: gpio
  366. pin:
  367. mcp23xxx: mcp23017_hub2
  368. number: 3
  369. mode: INPUT_PULLUP
  370. inverted: True
  371. name: "Status 1-d4"
  372. device_class: light
  373. # H3-5
  374. - platform: gpio
  375. pin:
  376. mcp23xxx: mcp23017_hub2
  377. number: 4
  378. mode: INPUT_PULLUP
  379. inverted: True
  380. name: "Status 1-d5"
  381. device_class: light
  382. # H3-6
  383. - platform: gpio
  384. pin:
  385. mcp23xxx: mcp23017_hub2
  386. number: 5
  387. mode: INPUT_PULLUP
  388. inverted: True
  389. name: "Status 1-d6"
  390. device_class: light
  391. # H3-7
  392. - platform: gpio
  393. pin:
  394. mcp23xxx: mcp23017_hub2
  395. number: 6
  396. mode: INPUT_PULLUP
  397. inverted: True
  398. name: "Status 1-d7"
  399. device_class: light
  400. # H3-8
  401. - platform: gpio
  402. pin:
  403. mcp23xxx: mcp23017_hub2
  404. number: 7
  405. mode: INPUT_PULLUP
  406. inverted: True
  407. name: "Status 1-d8"
  408. device_class: light
  409. # H3-9
  410. - platform: gpio
  411. pin:
  412. mcp23xxx: mcp23017_hub2
  413. number: 8
  414. mode: INPUT_PULLUP
  415. inverted: True
  416. name: "Status 1-d9"
  417. device_class: light
  418. # H3-10
  419. - platform: gpio
  420. pin:
  421. mcp23xxx: mcp23017_hub2
  422. number: 9
  423. mode: INPUT_PULLUP
  424. inverted: True
  425. name: "Status 1-d10"
  426. device_class: light
  427. # H3-11
  428. - platform: gpio
  429. pin:
  430. mcp23xxx: mcp23017_hub2
  431. number: 10
  432. mode: INPUT_PULLUP
  433. inverted: True
  434. name: "Status 1-d11"
  435. device_class: light
  436. # H3-12
  437. - platform: gpio
  438. pin:
  439. mcp23xxx: mcp23017_hub2
  440. number: 11
  441. mode: INPUT_PULLUP
  442. inverted: True
  443. name: "Status 1-d12"
  444. device_class: light
  445. # H3-13
  446. - platform: gpio
  447. pin:
  448. mcp23xxx: mcp23017_hub2
  449. number: 12
  450. mode: INPUT_PULLUP
  451. inverted: True
  452. name: "Status 1-d13"
  453. device_class: light
  454. # H3-14
  455. - platform: gpio
  456. pin:
  457. mcp23xxx: mcp23017_hub2
  458. number: 13
  459. mode: INPUT_PULLUP
  460. inverted: True
  461. name: "Status 1-d14"
  462. device_class: light
  463. # H3-15
  464. - platform: gpio
  465. pin:
  466. mcp23xxx: mcp23017_hub2
  467. number: 14
  468. mode: INPUT_PULLUP
  469. inverted: True
  470. name: "Status 1-d15"
  471. device_class: light
  472. # H3-16
  473. - platform: gpio
  474. pin:
  475. mcp23xxx: mcp23017_hub2
  476. number: 15
  477. mode: INPUT_PULLUP
  478. inverted: True
  479. name: "Status 1-d16"
  480. device_class: light
  481.  
Add Comment
Please, Sign In to add comment