Open raidr1 opened 1 year ago
The addon is just a galvanic isolated adapter for GPIO pins. It's transparent to ESPHome.
I don’t believe it’s a simple passthrough. It connects to the serial/debug header on the Plus devices and expands the host device with support for 1-Wire, one additional ADC and one additional GPIO. Those aren’t exposed via that header.
In addition, Shelly documents the addon as using a …
Shelly proprietary serial interface to connect to a Shelly Plus device source
I opened mine up and the pins trace through to seperate pins on the isolator chip, I'm pretty sure it's not using uart based on the chip model number. The first chip in addon from pins is a NSi8120 which is just optoissolator. I tried tracing put the tiny tracks and components and as far as I could tell it did indeed seem to just passthough. I mean the tx and rx pins on esp presumeably are also gpio if repourposed. My conserne on simplicity was with the old addon you still need a custom component to use the 1wire probes which included an additional pin definition. Perhaps enable? As pretty sure addon needs enabling and reboot in stock firmware I beleive.
Thanks for tracing these out! That makes sense. Yeah, RX0/TX0 can be re-muxed to be I/O, and then we have IO19 and IO0 on the pin header. Good call.
I'm interested in the extra analog input. None of those four pins seem (according to the datasheet; I don't know if they do in practice) to support ADC... 🤷🏻
Thanks for tracing these out! That makes sense. Yeah, RX0/TX0 can be re-muxed to be I/O, and then we have IO19 and IO0 on the pin header. Good call.
I'm interested in the extra analog input. None of those four pins seem (according to the datasheet; I don't know if they do in practice) to support ADC... 🤷🏻
Don't quote me on the above tracing but the following 😅 But one I put that I think is the analoge trace goes through a seperate chip labeled 3PEAK 393a BQLh and although can't find an exact match on Google maybe it's doing some pre processing for that?
The biggest ic is a small transformer (https://www.lcsc.com/product-detail/Power-Transformer_VPSC-VPT87BB-01B_C2846914.html). Additional Infos may be sourced here: https://github.com/mongoose-os-apps/shelly-homekit/issues/1146
Any movement on the use of the Addon within ESPHome? Would be a great addition to the existing shelly gear.
But one I put that I think is the analoge trace goes through a seperate chip labeled 3PEAK 393a BQLh and although can't find an exact match on Google maybe it's doing some pre processing for that?
It's this one - LM393A datasheet
Is there any possibility of using the addon with ESPHome? Thanks you!
I've spent some time figuring out how the ADC works on this. It actually appears as the duty cycle on the RX pin (GPIO3). This config appears to read it correctly:
sensor:
- platform: duty_cycle
pin: 3
name: Duty Cycle Sensor
update_interval: 5s
The board is generating a sawtooth input to one pin of the comparator, with the analog input on the other, giving a digital output with duty cycle representing the analog input. I don't fully understand the circuit, as it appears that the frequency and amplitude of the signal vary according to the resistors.
I think the other pins are: GPIO19 - digital input, GPIO0 1-wire TX, GPIO1 1-wire RX. I've not tried, but I think that https://github.com/esphome/esphome/pull/1346 would allow you to use the DS18B20 sensors with it, if you set pin: 1
, pin_a: 0
. It looks like the PR needs some work to sort out some compilation issues.
I have the dht working https://github.com/ashp8i/esphome-configs/tree/main/my_external_components/test4/shelly_dht
using the following config: -
sensor:
- platform: shelly_dht
pin: GPIO1
pin_a: GPIO0
temperature:
name: "Living Room Temperature"
humidity:
name: "Living Room Humidity"
update_interval: 60s
I need to find a way how to leave the original component alone but add ifdef or new methods for the shelly that uses two pins, same goes for the dallas, my plan for the dallas side is to add support for 1-Wire via RMT peripheral (ESP32's) and make the bitbanging more robust for the ESP8266, and support Switch and I2C bridge, sorry not high-jacking thread, trying to give this some direction.
Is it possible to integrate a CT sensor with the Shelly 1 Plus using the add-on module? Currently, my Shelly Plus 1PM, connected to my boiler, is experiencing issues with overheating. Could using a Shelly Plus 1 with a dry contact potentially resolve this problem?
I've spent some time figuring out how the ADC works on this. It actually appears as the duty cycle on the RX pin (GPIO3). This config appears to read it correctly:
sensor: - platform: duty_cycle pin: 3 name: Duty Cycle Sensor update_interval: 5s
The board is generating a sawtooth input to one pin of the comparator, with the analog input on the other, giving a digital output with duty cycle representing the analog input. I don't fully understand the circuit, as it appears that the frequency and amplitude of the signal vary according to the resistors.
I think the other pins are: GPIO19 - digital input, GPIO0 1-wire TX, GPIO1 1-wire RX. I've not tried, but I think that esphome/esphome#1346 would allow you to use the DS18B20 sensors with it, if you set
pin: 1
,pin_a: 0
. It looks like the PR needs some work to sort out some compilation issues.
Hi, would you be able to suggest a configuration for an NTC resistor to use it as a temperature sensor (underfloor heating, 10Kohm at 25deg C)? Seems that the original shelly fw does support it so the hardware should be OK. I know I could use dallas sensor but the ntc is already buried in the floor.
Thank you in advance! Yasa
Hi, would you be able to suggest a configuration for an NTC resistor to use it as a temperature sensor (underfloor heating, 10Kohm at 25deg C)? Seems that the original shelly fw does support it so the hardware should be OK. I know I could use dallas sensor but the ntc is already buried in the floor.
This is actually exactly what I use my Shelly add-ons for :smiley:
- platform: ntc
sensor: resistance_sensor
calibration:
- 11.4kOhm -> 26.6°C
- 13.17kOhm -> 24°C
- 16.17kOhm -> 18.8°C
name: Floor Temperature
id: floor_temperature
- platform: resistance
id: resistance_sensor
sensor: add_on_adc
configuration: DOWNSTREAM
resistor: 10kOhm
name: Resistance Sensor
- platform: duty_cycle
pin: 3
id: add_on_adc
name: "Add-on ADC"
update_interval: 5s
unit_of_measurement: "V"
filters:
- offset: -2.0
- multiply: 0.033
The calibration was based on measuring the existing NTC and taking readings from the existing floor controller.
I can't remember how I arrived at the offset
value for the duty cycle filter. The 0.033
is to transfer 100% duty to 3.3V.
Thank you @pdw-mb. I will definitely try in once my add-on arrives.
Me too. My Addon arrives on Friday.
Any news on using dallas ? My addon arrived today. And i cant get it to work
Does anyone think it would be possible to run a PWM signal on GPIO19 of the add-on? Perhaps in combination with a DHT22 (since that uses GPIO1 according to this comment )? The PWM signal would be to adjust the speed of a fan. I know its possible to control a PWM fan in ESPHome, but I am unsure if the galvanic isolation of the add-on would affect the signal.
Edit (11Jul2024): After testing that the PWM signal correctly controls a fan via the 7 pin female header on the back of a Shelly Plus 1PM, I've concluded that the galvanic isolation in the Shelly Plus Add-On prevents the PWM signal from passing through to the add-on terminals.
Hy @KaufDirEins
Any news on using dallas ? My addon arrived today. And i cant get it to work
Did you already get them to work?
Mike
Describe the problem you have/What new integration you would like
Add support for Shelly Plus Addon
Please describe your use case for this integration and alternatives you've tried:
it would be nice to integrate with all Shelly Plus devices
Additional context