landonr / homeThing

Wifi Smart Home Remotes that run on ESPHome
https://homething.io
GNU General Public License v3.0
441 stars 31 forks source link

Make Homething node, display/subscribe to Home Assistant "notify.notify" service events . #138

Open ManuRiver opened 1 month ago

ManuRiver commented 1 month ago
          This sparked the following idea and wanted to share back with you guys.

Add the following self published service to esphome config file.

service: ##provisions a self published service back to homeassistant thru esphome api.

api:
  encryption:
    key: !secret api

  services:
    - service: notify_homething
      variables:
        title: string
        message: string
        # type_str: string
      then:
        - lambda: |-
            id(homeThingMenu)->addNotification(title, message, "", true);

configuration.yaml on the hass side, profit ;-)

notify:
  - platform: group
    name: "Notify Homething"
    services:
      - service: esphome ##propagates the notify.notify events back to the variables and calls back the service.
        data:
          target: studiotdisplay_notify_homething

Originally posted by @ManuRiver in https://github.com/landonr/homeThing/issues/116#issuecomment-2253511153

landonr commented 1 month ago

great idea thanks for making the issue!

i think I can add the service directly to the homething component so we don't have to include it in the config. I'll take a loo