Hm, no idea what goes wrong. The first time it can give this result sometimes, but it should work the second time? Just tested right after esp reboot, this is what I get on two sequential tries:
> =dofile("dht22.lua").read(4,false,false)
nil 2
> =dofile("dht22.lua").read(4,false,false)
220
>
I've now created a github repository to not clutter this thread with always new code versions:
Ok changed file again and rock'n'roll... it works !
But you read from GPIO2 and not GPIO0 pin 4
this is the issue...
very happy ! just one cosmetic things... is it difficult to put % after hum and ° after temp ?
I suppose it is possible, but I've no BMP080 or BMP180 here to test.
edit - but I think when it needs two pins, then we can only connect BMP sensor and nothing else with ESP-01 modules. And esp is very power-hungry, I had a node running on 9V block with regulator set to 3,3v, it lasted only one day...
Hello easyIoT,
If I update position, then event to send value is triggered again - this is why sometimes it goes in loop. So I've removed position update. I don't know better method to disable event when value is updated.
The "update" event is triggered by graphical change of wheel position? What about triggering separate "graphical update" event for wheel, when sensor value changes, without triggering another update event for value change?
So that you've got two events: one for "real" change in module's values (initiated by user or automation; which also triggers graphical change event), the other just for the graphical change of wheel position (triggers *no* other event)?
ATM the numeric dimmer value works just like this I think, even with new js script you provided, it is visually updated properly on all clients when changed. Without loop.
edit - or you need to somehow differenciate between "wheel changed by user interaction" and "wheel changed by graphical update mechanism" to get wheel position updates to work properly?
You are right, but it doesn't work like that. When I change value event is also triggered. I didn't find a way to detach event. This happens in javascript in browser. I think it's bug in knob control.
Hey Dennis, i've seen in your GitHub new version with value.txt that record dimmer value! Great Idea, because before if module reset led goes off ! Thank you.
Now i've edited your init.lua to use bmp180. I've seen that Vladimir has done also query module for it.
Here it is !
Changing init.lua for me is very simple... but ... what is necessary to change in query module? thanks a lot