Very clean setup. For this particular Air Wick model without converting it to smart, how does it activate?
For my model, it spray once motion is detected AND every 30 minutes( something like that) throughout the day whether it detects motion or not. Marketing scheme to make you constantly buy the refills.
This particular model sprays 15 seconds after activated, then every 30min or so. This initial spray is what made this clean setup possible. From Home Assistant I simply turn the device on when no one is in the room and turn it off some time after. If you ignore the 15 seconds you could say I have direct control of it spraying.
Here’s a simplified copy of my rules.
On:
- trigger:
- platform: state
entity_id: binary_sensor.bathroom_door
to: "off"
for:
seconds: 5
condition:
- condition: state
entity_id: light.bathroom
state: "off"
action:
- service: switch.turn_on
entity_id: switch.airwick
Off:
- trigger:
- platform: state
entity_id: light.bathroom
to: "on"
- platform: state
entity_id: switch.airwick
to: "on"
for:
minutes: 30
condition:
- condition: state
entity_id: switch.airwick
state: "on"
action:
- service: switch.turn_off
entity_id: switch.airwick
No magic on the ESP either. It’s running standard Tasmota with one “Switch” GPIO.
This is great, thank you so much for sharing. I’d love to see more pictures of the inside as well as the reassembled Air freshener. For example, where does the USB cable enter the air freshener?
If it is not, change the GPIO pins at forward and reverse pin.
I’ve received all my parts and have done soldering. When I test the motor, it is turning the opposite direction. I am confused of what to change as I have tried a couple of ways, but the motor does not change direction.
I have tried swapping the gpio pins on the d1 mini. Change the pin id labels in the config file.
Hey guys,
just out of curiosity and because someone might have missed it. I did show my solution to this problem a couple of responses earlier in this thread. It is a fully satisfying technical solution with minimal effort.
Why do you guys bother to go through massive rebuilds of the devices internals? Is it only because you already have your other air freshener model at home and it wouldn’t work that way? The Air Wick Freshmatic model I own costs 5-10€ and the modifications are straight forward
The wiring should be ok.
At the picture with the dc motor, I see a red an black wire. Not sure if they are connected to the motor or not.
The motor should be only connected to the DRV board.
@ThomDietrich yes, there are multiple solutions.
The reason why I was using my approach was because of full control. For the Airwick, I would prefer your solution.
Not everybody has the same tools like a 3D printer.
Isn‘t it the nice wonderful part on open source and communities? You get different ideas and solutions and you can pick that one you want.
My solution is only one, not intended to be the best but one way you can do it. For me it is and was fun to get a little bit of deep dive into dc motors and how to control it with ESPHome. Learning by doing.
The motor should be only connected to the DRV board.
Hmmm. The red/black wire from the motor is stillconnected to the stock pcb board and not the to drv board. I left it as is just in case I want to revert back to the original. Should I disconnect the red/black wires from the motor so just have the wires go to the drv board only??
The Air Wick Freshmatic model I own costs 5-10€ and the modifications are straight forward
Not every countries carry the same model. Where I live, I can only find this particalur one and it isn’t your model or daxi’s.
Isn‘t it the nice wonderful part on open source and communities? … For me it is and was fun to get a little bit of deep dive into dc motors and how to control it with ESPHome. Learning by doing.
Love this! It’s exactly why I did a lot of what I did. Not because it was desperately necessary, but because I wanted to try In fact, you might enjoy one of my previous projects, which is quite similar to your approach with the air freshener: SenseoWifi/README.md at master · ThomDietrich/SenseoWifi · GitHub
Not everybody has the same tools like a 3D printer.
Good point I got mine over the Covid time, a wonderful time waster
I will remove those stock wires from motor when I get the chance. During my testing, I noticed the counter resets to 0 when the esp device loses power. Is there a way to keep the counter from resetting during a power outage/disconnect?
You will see a new log output at ESPHome like that (first line):
[22:08:14][D][esp8266.preferences:238]: Saving preferences to flash...
[22:08:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 6.00000 with 0 decimals of accuracy
[22:09:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 6.00000 with 0 decimals of accuracy
[22:10:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 6.00000 with 0 decimals of accuracy
[22:11:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 6.00000 with 0 decimals of accuracy
[22:11:30][D][button:013]: 'Bad Lufterfrischer Spray' Pressed.
[...]
[22:12:14][D][esp8266.preferences:238]: Saving preferences to flash...
[22:12:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 7.00000 with 0 decimals of accuracy
[22:13:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 7.00000 with 0 decimals of accuracy
[22:14:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 7.00000 with 0 decimals of accuracy
[22:14:47][D][button:013]: 'Bad Lufterfrischer Sprühzähler zurücksetzen' Pressed.
[22:14:47][D][number:054]: 'spray_counter' - Setting number value
[22:14:47][D][number:113]: New number value: 0.000000
[22:14:47][D][number:012]: 'spray_counter': Sending state 0.000000
[22:15:14][D][esp8266.preferences:238]: Saving preferences to flash...
[22:15:17][D][sensor:126]: 'Bad Lufterfrischer Sprühzähler': Sending state 0.00000 with 0 decimals of accuracy
It seems that the interval of 1min is only applied if a value has changed.
The sending state lines are the Home Assistant API updates to send the state to Home Assistant.
After the test I have done a reset and checked if this will lso work.
Found an additional thing: The reset counter does not instant update of the state like the spray button does. Changed that too with this commit: