Comments (3)
Hi @guevara777 , in the image you connect GPIO 18 and 19, but in the code you define the tx and rx for 16 and 17. Is that just a typo?
I'm using the exact same devices but I can't get this setup to work...
from loctekmotion_iot.
The Image is wrong. In the code it´s right. I use the GPIO-Pins 16 and 17 like this:
uart:
id: desk_uart
baud_rate: 9600
tx_pin: GPIO17
rx_pin: GPIO16
I also added a position-action since i posted it here. You can populate the cover to Alexa and use voice commands like "set the desk to 70%".
for this you have to add this to the yaml-file:
# Move desk to desired position
position_action:
#Check if we need to move desk up or down from current position
if:
condition:
#Current height is more than target height, then move desk down
lambda: |-
float position = (float(id(desk_height).state) - float(${min_height})) / (float(${max_height}) - float(${min_height}));
return pos < position;
then:
- logger.log: "Schreibtisch muss runter gefahren werden"
- while:
condition:
# Move down till the current height is smaller then the target height
lambda: |-
float position = (float(id(desk_height).state) - float(${min_height})) / (float(${max_height}) - float(${min_height}));
return pos < position;
then:
- logger.log: "Executing down command"
- cover.template.publish:
id: desk_cover
current_operation: CLOSING
- uart.write:
id: desk_uart
data: [0x9b, 0x06, 0x02, 0x02, 0x00, 0x0c, 0xa0, 0x9d]
- delay: 108ms
else:
- logger.log: "Schreibtisch muss hoch gefahren werden"
- while:
condition:
# Move up till the current height is bigger then the target height
lambda: |-
float position = (float(id(desk_height).state) - float(${min_height})) / (float(${max_height}) - float(${min_height}));
return pos > position;
then:
- logger.log: "Executing up command"
- cover.template.publish:
id: desk_cover
current_operation: OPENING
- uart.write:
id: desk_uart
data: [0x9b, 0x06, 0x02, 0x01, 0x00, 0xfc, 0xa0, 0x9d]
- delay: 108ms
from loctekmotion_iot.
Hi guys. If I add the second part (Move desk to desired position) i get a double definition error from position_action.
I‘m a noob in coding and do need help there. Can anyone help me?
from loctekmotion_iot.
Related Issues (20)
- Long Press M (Lock/Unlock) HOT 1
- FlexiSpot E7 Pin Map in Readme HOT 2
- No Issue | Tip for a Mushroom-Desk-Card HOT 1
- Anti-Collision function not present. HOT 2
- ESP won't boot up with keypad connected HOT 16
- D1 mini seems to crash when power is supplied via Ethernet [HS13B-1, Flexispot E7] HOT 3
- Implement Time Reminder / alarm functionality
- HS13M - probably works the same HOT 8
- [Testers wanted] New ESPHome configuration and documentation improvements HOT 67
- HS11A-1C0 HOT 2
- Update height when controlling through original keypad HOT 9
- Add Support for CB38M4A(IB)-1 HOT 1
- FlexiSpot Q8 "Comhar Pro" w/ controller HCB215C-4 HOT 3
- HCB110
- Raspberry-pi package does not work for HS01B-1 CB38M2A-1
- Wemos ESP32 S2 mini cannot boot with UART connected
- How to emulate multiple simultaneous button presses? HOT 1
- ESP8266 D1 Mini not receiving output
- FLEXISPOT EC5 - HS11A-1C0 + CB38M2H(PB)-1 compatibility ? HOT 4
- flexispot automation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loctekmotion_iot.