-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to analogue pin #137
Comments
I was looking into this - the adc is also available on the sonoff dev and accessing the value from firmware is trivial but integrating it into everything else a little harder How do you propose we would report the data? Using the tele command with the same tele-period? How would you enable/disable the value - perhaps an enable/disable flag on the module selection/gpio configuration page? The ADC can also be configured to report the input voltage to the esp -so perhaps a drop down of ADC Enabled field with the following options "Off", "A0", "VCC" |
@khcnz now that is seriously usefull. How does anyone want to receive the information? |
As A0 repor will be 0-1024 from memory. VCC reports the voltage in mv (so approx 3300). I am still thinking something in the tele command will be most useful - I will have a PR in the next couple of hours to review. |
Well I got this mostly implemented so it can be configured on the GPIO page.... only to (rediscover) that you can't configure the VCC/A0 dynamically; You can only set ADC_MODE(ADC_VCC) outside of a function. So we are left with a preprocessor to select between VCC and A0 - which makes the point of dynamically selecting it within the module configuration GPIO PINS page a little pointless... It also looks like we would likely need a correction factor esp8266/Arduino#721 |
More useful info http://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations I propose
|
@jaysuk I think this one can be closed now? |
It can. Will close it now
…On 16 Mar 2017 1:24 pm, "khcnz" ***@***.***> wrote:
@jaysuk <https://github.com/jaysuk> I think this one can be closed now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACdJBhu1SBLpF0gMHBybBmysVubxH9CUks5rmTftgaJpZM4MQ7MT>
.
|
Hi, is it possible to publish the analog value of pin A0 as telemetry data? Something like this: tele/sonoff/A0 -> 0.99 |
the A0 pin reading has been reported since version 4.something. You can't scale
it in the firmware, do that in the software receiving it.
|
Ok, thanks, but what is the topic where it gets published? |
it would be part of the tele/ reports. You also will see it as a result of a
status 0 command
|
How I can activate the Analog pin for Wemos D1 mini pro ? - I dont find the pin in configuration menu |
4.0.5 20170314 * Add command Status 11 to show power status with Vcc if define USE_ADC_VCC is enabled (default) * Add ADC input to Sonoff SV and Wemos D1 mini - Needs recompile with define USE_ADC_VCC disabled (arendst#137) * Add MQTT host:port to timeout message (arendst#199)
4.0.5 20170314 * Add command Status 11 to show power status with Vcc if define USE_ADC_VCC is enabled (default) * Add ADC input to Sonoff SV and Wemos D1 mini - Needs recompile with define USE_ADC_VCC disabled (arendst#137) * Add MQTT host:port to timeout message (arendst#199)
Hi, I enabled the ADC pin on compile, and I can see the raw value now displayed on the main web UI. I want t o send this value as a "custom sensor" value to Domoticz. I have a Custom Sensor configured on Domoticz ready to receive the data, and I would think I would find a way to establish the IDX destination for the A0 pin value to be sent to that Domoticz device - but I can't find any selection for the A0 pin on the Module Parameters page on Module Config. It would be really useful to be able to send a raw analog value to Domoticz. My use case is monitoring a water level that uses a simple conduction probe connected to A0. I could then use this raw data to create actionable results via Domoticz. How can I achieve this in Tasmota? I am running version 6.4.1.8 |
Sending every change to MQTT and/or domoticz would flush bothservers. There is a feature I use to control the dimmer of led by using the ADC input of another device. To use this you will have to define a rule. This rule can also be used not to send the ADC info to the led but to Domoticz. This is my led rule:
As you can see there is a trigger that activates with every tenth change in the analog input. Using the rule examples from the wiki (https://github.com/arendst/Sonoff-Tasmota/wiki/Rules#examples) you must be easily able to send these changes to domoticz with something like:
You'll have to find the correct domoticz sensor svalue syntax depending on the type of custom sensor you defined. The idx is the idx of the sensor in Domoticz. |
Theo, Thank you for your assistance. Your suggestion helped me to successfully report the values to a custom sensor object in Domoticz. I can see the value sent whenever it changes on A0. I would like to be able to send the value whenever the telemetry period fires. Currently, in the console, I see the value returned every few minutes. The way it is now, Domoticz only gets a new value when there is a delta. Here's what I have in the console:
Here's what my rule1 looks like:
Can you suggest how I send this to Domoticz when the telemetry runs? Thanks a lot and thank you for the Tasmota project! I love it. |
Hint: on tele-analog#a0 do publish ... |
Theo,
That did send up the data for A0 on every telemetry, but the value presented is not the value div by 10. (I was seeing 100, but now am seeing 1024). I tried to add the divider in as follows but then the rule did not work:
Perhaps I erred on the syntax or maybe the div10 does not apply correctly? Could I do %value%div10 in the latter part of the rule or would it not scale the value on the fly? |
Due to changes in interlock the right operation mode was not detected correctly. Fixed. As soon as one of the shutterrelay is in interlock configuration is normal or pulse.
Merge pull request #137 from IVI053/patch-2
On the wemos d1 mini etc, as well as digital pins, there is 1 analogue pin.
Would it be possible to be able to configure this as report the value back?
This value would be between 0 and 1023.
The text was updated successfully, but these errors were encountered: