lucavb / homebridge-esphome-ts

This plugin integrates your esphome devices into HomeKit!
GNU General Public License v3.0
47 stars 16 forks source link

Add more device #8

Open criscarr opened 4 years ago

criscarr commented 4 years ago

Hello!!! I have one wemos mini d1 and a node Mcu v3 conect to home assistance working normal, but in Hoobs only show one devide. please can you help me with de code example using two or more devices

lucavb commented 4 years ago

Please provide me with information on both your homebridge config & the config you are using for esphome. Make sure to remove any sensitive information like passwords before posting it.

criscarr commented 4 years ago

ok on Home Assistance the devices work fine, with a relay on gpio D1 Wemos mini config

esphome:
  name: gate
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "xxxxxxx"
  password: "xxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Gate Fallback Hotspot"
    password: "xxxxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "xxxxx"

ota:
  password: "xxxxxl"

switch:
  - platform: gpio
    pin: D1
    id: relay
  - platform: template
    name: "Gate Remote"
    icon: "mdi:gate"
    turn_on_action:
    - switch.turn_on: relay
    - delay: 1500ms
    - switch.turn_off: relay 

nodeMcu v3config

esphome:
  name: luzhomekit
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "xxxx"
  password: "xxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Luzhomekit Fallback Hotspot"
    password: "xxxxxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "xxxxxx"

ota:
  password: "xxxxx"

On HOOBS in the plugin config:

[
    {
        "host": "gate.local",
        "password": "xxxx",
        "port": 6053
    }
]

host for wemos is luzhomekit.local host for nodemcuv2 is gate.local same password an port

lucavb commented 4 years ago

Well your homebridge config is missing the 2nd device so it won't show. You only have gate.local

criscarr commented 4 years ago

yes, and i tray to add to the code but I do not know how. I don't know much about coding, I'm just an enthusiast. I have tried things like, unsuccessful [ { "host": "gate.local", "password": "xxxx", "port": 6053 } { "host": "luzhomekit.local", "password": "xxxx", "port": 6053 } ]

can you help me with de code example using two or more devices

lucavb commented 4 years ago

Sure. That one is missing a comma in particular. Between the two {} brackets. You best try to check if with something like this website: https://jsonformatter.curiousconcept.com/ . If it says that it is invalid json it won't work.

criscarr commented 4 years ago

Yes now everything works. Thanks for your help, hopefully this post help other users

Excellent work, congratulations to you

One more thing, the wemos is acting as a push button, it should return to its OFF state after 1500 ms, that works fine, but in the HOME application the state of the button remains ON after 1500 ms and physically the relay is OFF, status in HomeAssistance works fine too. It can be fixed?

lucavb commented 4 years ago

I will have to test this maybe next week. Right now I am unable to.