Zegarek podświetlany z niemymi powiadomieniami DIY

Jak wieczorem oglądam telewizje muszę patrzeć na telefon która jest godzina, więc szukałem zegarka żeby postawić przy telewizorze, żeby mieć czas pod kontrolą. Na noc telefony się wyciszają, więc żadnych powiadomień nie słyszę. To muszę zrobić zegarek z powiadomieniami :slight_smile:

Potrzebujemy:
MAX7219
image
i płytkę np. wemos

no i jakąś obudowę,
mam drukarkę więc wziąłem pierwszy lepszy projekt:

chciałem czarny filament więc musiałem zmniejszyć grubość frontu do jednej warstwy 0.2mm - jest jak papier :slight_smile: ale widać podświetlone cyfry

Podłączamy płytkę do wyświetlacza
image

Wgrywamy ESPhome

esphome:
  name: matrix
  platform: ESP8266
  board: d1_mini

logger:

api:

ota:
  password: "bhthnjtrjrtjtrhththth"

wifi:
  ssid: *****
  password: ******

web_server:
  port: 80
  
  
captive_portal:

mqtt:
  broker: 192.168.00.00

time:
  - platform: homeassistant
    id: homeassistant_time
globals:
  - id: hapage
    type: int
    restore_value: no
    initial_value: '1'
    
spi:
  clk_pin: D5
  mosi_pin: D7

display:
  - platform: max7219digit
    id: display_max
    cs_pin: D8
    num_chips: 8
    intensity: 3
    scroll_speed: 100ms
    update_interval: 100ms
    lambda: |-
           if(id(power_on_off).state) {  
           it.intensity(atoi(id(habri).state.c_str()));
           if (id(hapage) == 1) {
             it.print(32, 0, id(digit_font), "UWAGA!");
             it.invert_on_off(true);
             it.scroll(false);
             }  else {
               if (id(hapage) == 2) {
               it.strftime(36, 0, id(digit_font), "%H:%M", id(homeassistant_time).now()); 
               it.invert_on_off(false);
               it.scroll(false);
                 
               } else {
                 if (id(hapage) == 3) {
                 it.printf(33, 0, id(digit_font), "%.1f°C", id(temp1).state); 
                 it.invert_on_off(false);
                 it.scroll(false);
                 
                 } else {
                    if (id(hapage) == 4) {
                    it.printf(32, 0, id(digit_font), "%s%%", id(humi1).state.c_str());
                    it.invert_on_off(false);
                    it.scroll(false);
                    
                    } else {
                    if (id(hapage) == 5) { 
                      it.printf(32, 0, id(digit_font), "%s", id(hatxt).state.c_str());
                      it.invert_on_off(false);
                      it.scroll_left();
                      }
                   
                   } } } } };
switch:
  - platform: template
    name: "Display Power Switch"
    icon: mdi:dots-grid
    optimistic: true
    restore_state: yes
    turn_on_action:
      - binary_sensor.template.publish:
          id: power_on_off
          state: ON
    turn_off_action:
      - binary_sensor.template.publish:
          id: power_on_off
          state: OFF

font:
  - file: "font/pixelmix.ttf"
    id: digit_font
    size: 8


    
text_sensor:
  - platform: wifi_info
    ip_address:
      name: "Display IP Address"
    ssid:
      name: "Display Connected SSID"
    bssid:
      name: "Display Connected BSSID"
  - platform: homeassistant
    name: "HA Txt"
    id: hatxt
    entity_id: input_text.matrix_text

  - platform: homeassistant
    name: "HA Brightness"
    id: habri
    entity_id: input_number.matrix_bri
    

  - platform: homeassistant
    name: "Podworko Humidity"
    id: humi1
    entity_id: sensor.czujnik_temperatury_podworko_humidity
    
sensor:                                        
  - platform: homeassistant
    name: "Podworko Temp"
    id: temp1
    entity_id: sensor.czujnik_temperatury_podworko_temperature
      
    
  - platform: wifi_signal
    name: "Display WiFi Signal Sensor"
    update_interval: 60s
  - platform: uptime
    name: "Display Uptime Sensor"

  - platform: homeassistant
    id: hapage1
    entity_id: input_number.matrix_page
    on_value:
      then:
        if:
          condition:
            lambda: 'return id(hapage) != int(x);'
          then:
            - globals.set:
                id: hapage
                value: !lambda 'return int(x);'
                
binary_sensor:          
    
  - platform: template
    name: "Power State"
    id: power_on_off
    internal: true
    

Mam tak że zmieniamy 5 widoków

  1. uwaga
  2. godzina
  3. temperatura
  4. wilgotnosc
  5. powiadomienie

podpiąłem sobie pod powiadomienia w NR, także jak jakies przychodzi to przełącza się na 1 ekran UWAGA i włacza wyłącza, potem na 5 z treścią powiadomienia, a normalnie wyświetla przygaszoną godzinę, temp, hum.
Możecie sobie zmienić po siebie, czy zrobic automatyzacje w HA, mi było tak wygodniej.

FLOW

[{"id":"e553902b1509771e","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_text","service":"set_value","entityId":"input_text.matrix_text","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":400,"wires":[[]]},{"id":"82ac0c48b5b3bf70","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": msg.komunikat.data.message,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":170,"y":340,"wires":[["e553902b1509771e","53fde1bb80062a52"]]},{"id":"b9f246a421b53ddb","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":true,"service_domain":"switch","service":"turn_off","entityId":"switch.display_power_switch_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":280,"wires":[[]]},{"id":"bda32504da1ca76e","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":true,"service_domain":"switch","service":"turn_on","entityId":"switch.display_power_switch_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":970,"y":280,"wires":[["643214fdbe969adb"]]},{"id":"643214fdbe969adb","type":"trigger","z":"a1b0527a20b603f8","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"3","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1170,"y":280,"wires":[["b9f246a421b53ddb"]]},{"id":"fcb1e05567b9ffeb","type":"change","z":"a1b0527a20b603f8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":280,"wires":[["bda32504da1ca76e"]]},{"id":"dd8d2d71623e2fd1","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.matrix_page","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":220,"wires":[["f37975410f0aefa8"]]},{"id":"b599eb9b07b7a753","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": 1,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":220,"wires":[["dd8d2d71623e2fd1"]]},{"id":"31ebb4562d41a818","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":true,"service_domain":"switch","service":"turn_off","entityId":"switch.display_power_switch_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":220,"wires":[["51335ca1b2efc625"]]},{"id":"828536a73d443735","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":true,"service_domain":"switch","service":"turn_on","entityId":"switch.display_power_switch_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1070,"y":220,"wires":[["c75042741792a2a8"]]},{"id":"c75042741792a2a8","type":"trigger","z":"a1b0527a20b603f8","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"1","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1240,"y":220,"wires":[["31ebb4562d41a818"]]},{"id":"51335ca1b2efc625","type":"trigger","z":"a1b0527a20b603f8","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"1","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1620,"y":220,"wires":[["39f437561dc75a29"]]},{"id":"39f437561dc75a29","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":true,"service_domain":"switch","service":"turn_on","entityId":"switch.display_power_switch_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1830,"y":220,"wires":[["93ea534fa54900e5"]]},{"id":"703d86605bd590fc","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.matrix_page","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":180,"wires":[["f93d53380c210c38"]]},{"id":"0e7c65be4cfb6d22","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": 5,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":180,"wires":[["703d86605bd590fc"]]},{"id":"f37975410f0aefa8","type":"change","z":"a1b0527a20b603f8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":220,"wires":[["828536a73d443735"]]},{"id":"732b3fdb422d5695","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.matrix_page","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1100,"y":600,"wires":[["6e0f12f26ad11609"]]},{"id":"7ba5abc6ba4a8ba0","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": 2,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":600,"wires":[["732b3fdb422d5695"]]},{"id":"9543ca1d5fb3ad35","type":"inject","z":"a1b0527a20b603f8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"0.2","topic":"","payloadType":"date","x":190,"y":580,"wires":[["ba781d3ef409b119"]]},{"id":"c24bafbca9ee0781","type":"afya-carousel-switch","z":"a1b0527a20b603f8","name":"","variableName":"licznik","maxValue":2,"x":400,"y":600,"wires":[["5906627fe32f66b5"]]},{"id":"73d6033b9d963679","type":"switch","z":"a1b0527a20b603f8","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":730,"y":600,"wires":[["7ba5abc6ba4a8ba0"],["d38c7e4ffe1282e8"],["6336b38b54a1a460"]]},{"id":"c5caafc1ca8ea311","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.matrix_page","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1100,"y":640,"wires":[["c57717d2ff0ab8ab"]]},{"id":"d38c7e4ffe1282e8","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": 3,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":640,"wires":[["c5caafc1ca8ea311"]]},{"id":"76e756d0ec28dfe9","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.matrix_page","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1100,"y":680,"wires":[["779c39aa0c989059"]]},{"id":"6336b38b54a1a460","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": 4,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":680,"wires":[["76e756d0ec28dfe9"]]},{"id":"c57717d2ff0ab8ab","type":"delay","z":"a1b0527a20b603f8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1300,"y":640,"wires":[["c24bafbca9ee0781"]]},{"id":"779c39aa0c989059","type":"delay","z":"a1b0527a20b603f8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1300,"y":680,"wires":[["c24bafbca9ee0781"]]},{"id":"6e0f12f26ad11609","type":"delay","z":"a1b0527a20b603f8","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1300,"y":600,"wires":[["c24bafbca9ee0781"]]},{"id":"f93d53380c210c38","type":"delay","z":"a1b0527a20b603f8","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":860,"y":180,"wires":[["ba781d3ef409b119"]]},{"id":"53fde1bb80062a52","type":"change","z":"a1b0527a20b603f8","name":"","rules":[{"t":"set","p":"matrix","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":360,"wires":[["c65f0e21167d6078"]]},{"id":"5906627fe32f66b5","type":"switch","z":"a1b0527a20b603f8","name":"","property":"matrix","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":600,"wires":[["73d6033b9d963679"]]},{"id":"ba781d3ef409b119","type":"change","z":"a1b0527a20b603f8","name":"","rules":[{"t":"set","p":"matrix","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":560,"wires":[["c24bafbca9ee0781","64fc6a35006898a1"]]},{"id":"f05f2b2cf0fbd676","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.matrix_bri","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":860,"y":540,"wires":[[]]},{"id":"64fc6a35006898a1","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": 0,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":540,"wires":[["f05f2b2cf0fbd676"]]},{"id":"c65f0e21167d6078","type":"function","z":"a1b0527a20b603f8","name":"KOMUNIKAT","func":"msg.payload=\n{\n    \"data\":\n    {\n        \"value\": 7,\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":360,"wires":[["f6cc80258e1fe0b2"]]},{"id":"f6cc80258e1fe0b2","type":"api-call-service","z":"a1b0527a20b603f8","name":"","server":"4d0e02c9.2307bc","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.matrix_bri","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1100,"y":360,"wires":[["b599eb9b07b7a753"]]},{"id":"4d0e02c9.2307bc","type":"server","name":"Asystent domowy","version":1,"legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

W HA mamy tak:
thtrjhtrjtr

Robota na 5 min, a sprawdza się elegancko POLECAM :slight_smile:


mam podpięte pod usb telewizora

8 polubień

Taki zegarek chętnie bym kupił :+1:.

Ja również podpinam sie pod kupno bez obudowy. Mam drukarkę :grin:

Jakie to proste i banalne :grinning:.