Home Assistant Community

Esphomelib - library to greatly simplify Home Assistant integration with ESP32

mqtt
esp8266
Tags: #<Tag:0x00007f3751d5e690> #<Tag:0x00007f3751d5e410>
#243

Thanks for the response and the example, this is very useful.

0 Likes

#245

Thanks for the example!
I tried this with generic MG 946R servo. With this servo I used idle position 0% and limits 3.5% to 12.5%.

0 Likes

#246

EDIT:
Nevermind, it seems to work again after another upload.

Hi all,
I’ve strange problem with esphome.
I’ve uploaded a configuration to a Wemos d1 mini.
It worked flawless the first time…
now the board works and I can upload new configuration both via usb that via Ota but I get an error when I try to see the logs.

INFO Reading configuration...
Traceback (most recent call last):
  File "/usr/local/bin/esphomeyaml", line 11, in <module>
    load_entry_point('esphomeyaml', 'console_scripts', 'esphomeyaml')()
  File "/opt/esphomeyaml/esphomeyaml/__main__.py", line 505, in main
    return run_esphomeyaml(sys.argv)
  File "/opt/esphomeyaml/esphomeyaml/__main__.py", line 495, in run_esphomeyaml
    return POST_CONFIG_ACTIONS[args.command](args, config)
  File "/opt/esphomeyaml/esphomeyaml/__main__.py", line 297, in command_logs
    return show_logs(config, args, port)
  File "/opt/esphomeyaml/esphomeyaml/__main__.py", line 224, in show_logs
    raise ValueError
ValueError

Thanks for any hint

0 Likes

#248

Im tryng to make the servo move with a potentiometer
https://pastebin.com/E8N8TXqc
This only retuns four values 0, 3, 9 and 12
What am i doing wrong?

0 Likes

#249

just wanted to drop in and say that this project is awesome. thanks @OttoWinter

0 Likes

#250

Me too! This project is amazing and I’m going to move all my ESP devices over to it asap. The one thing which is stopping me at the moment is the ability for my current firmwares to “remember” their state following a power cycle/ restart.

I.e. tasmora does a " DEFAULT the relay(s) will power on with the last saved state on a reboot/restart."

See:

And espurna has a toggle to remember the last light status including colour value.

Is there anyway these can be included? Or find out how they do it?

1 Like

#251

Check out the gpio switch options in esphome:

restore_mode ( Optional ): Control how the GPIO Switch attempts to restore state on bootup.

  • RESTORE_DEFAULT_OFF (Default) - Attempt to restore state and default to OFF if not possible to restore.
  • RESTORE_DEFAULT_ON - Attempt to restore state and default to ON.
  • ALWAYS_OFF - Always initialize the pin as OFF on bootup.
  • ALWAYS_ON - Always initialize the pin as ON on bootup.
1 Like

#252

yep i saw those, but looks like they relate to GPIO switch only.

There’s an enhancement request on the way…

1 Like

#253

Does anybody know if its possible to use the restore_mode option with lights (instead of switches) ?

light:
  - platform: binary
    name: "Sonoff Kitchen"
    id: sonoff_kitchen
    output: relay

output:
  - platform: gpio
    pin: GPIO12
    id: relay

I have a sonoff basic configured as above so it is exposed to HA as a light rather than switch, but i can only see the restore_mode option on the switch component.


edit: found a solution after posting

esphome:
  on_boot:
    priority: 49
    then:
      - light.turn_on: sonoff_kitchen
  name: sonoff_kitchen
  platform: ESP8266
  board: esp01_1m
  board_flash_mode: dout
0 Likes

#254

Not sure if this has been mentioned. I am using the latest version of esphome and have noticed the below since changing over from the older version.

I have 16 relays connected to a single nodemcu esp8276. When i update the nodemcu or restart hass all the relays cycle on then off one at a time, but very quickly, a fraction of a secord. The previous verson of esphome did not do this. How would I prevent this from happening? Can take a video if it makes it easier to see what’s happening.

0 Likes

#255

“latest” and “previous” are not versions.

0 Likes

#256

Latest = 1.11.1
Previous = 1.10.1

0 Likes

#257

@sparkydave Can you please post working yaml for WS2812B led strip?

0 Likes

#258

I am trying to implement an MPU6050 on my Node MCU. When I get everything going, I have no problem connecting, the 6050 is seen on the I2C bus, and the pins are correctly connected. However, I only get 0 back for all my sensors, and 36.5 back for my temp sensor on it at all times.

Seems in my reading ghat this has to do something with some kind of sleep mode perhaps, but can’t figure out how to turn it off.

My code is below, with the new name changes for v 0.88

Any help that could be offered would be greatly appreciated!

esphome:
  name: dryer
  platform: ESP8266
  board: nodemcuv2
  arduino_version: recommended

wifi:
  ssid: redacted
  password: redacted
  manual_ip:
    static_ip: redacted
    gateway: redacted
    subnet: redacted

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

mqtt:
  broker: redacted
  username: redacted
  password: redacted

i2c:
  sda: D2
  scl: D1
  scan: True
  
sensor:
  - platform: mpu6050
    address: 0x68
    accel_x:
      name: "MPU6050 Accel X"
    accel_y:
      name: "MPU6050 Accel Y"
    accel_z:
      name: "MPU6050 Accel z"
    gyro_x:
      name: "MPU6050 Gyro X"
    gyro_y:
      name: "MPU6050 Gyro Y"
    gyro_z:
      name: "MPU6050 Gyro z"
    temperature:
      name: "MPU6050 Temperature"

0 Likes

#260

@OttoWinter. Do you support either of the two currently shipping POE implementations yet ?

0 Likes

#261

Just wanted to drop another Thank You! to @OttoWinter for such and awesome project.

0 Likes

EspHome sonoff 2 way switch functionality (3 way US) automation
#262

Hi everyone ,

Quick question, if I use the native API to set up EspHome is it possible to set up a 2 way switch setup i.e 1 light 2 switch’s ( 3 way in US). I’ve done this in tasmota with mqtt messages on button presses, but is this possible in someway using the API integration?

0 Likes

#263

Hi,

With HA you can set this quite easy, almost hardware agnostic. Just set an automation that will trigger depending on buttons pressed (can have as many switches as one likes and there is no need for going with 3/4 physical wires to each switch to achieve the same).

  - alias: multi way switch
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: binary_sensor.binary_sensor_1, binary_sensor.binary_sensor_2, binary_sensor.binary_sensor_3
.#actually can use quite a few different type of switches, not necessarily set as binary sensors (but for binary sensors HA will set them to off even if they don't send a different signal)
        to: 'on'
    action:
      - service: light.toggle # service can also be switch.toggle (if the light is controlled by a switch).
        entity_id: light.light_a
1 Like

#264

Thanks for this , now that you have explained it I feel silly not thinking about using HA to automate the process which is pretty obvious .

Appreciate the help though :+1:

0 Likes

#265

FWIW, I attempted this and had similar results with the accelerometer/gyro sensor (MPU6050).

0 Likes