Question ESPhome / Home Assistant bed raiser project project

Jan 23, 2022
2
0
10
0
Hi all,

I hope this is the correct section to place this,
I have a project which I am hoping someone can help me with, I have two electric car jacks which I have installed into my camper to raise and lower the couch to make a double bed.
These work well for this purpose, they are 1.5 tom jacks anf fit my needs perfectly
IMG202201191520161920×1440 295 KB
IMG202201191529471920×1440 244 KB
IMG202201191529431920×1440 229 KB

These jacks have a hand held control, this control has two relays and a seperate up and down button, there is also two reed switches built into this to stop the jacks at the end of the travel.
What I have done is used a NodeMCU V3 and a 4 way solid state relay, I have fixed a wire to each of the toggle switches on the jack PCB and plugged this into one of the relays to activate the switch then set a delay for 120s to allow the unit to complet the travel to the fully extended position.
I have used one relay per switch.
The code I have used is below:
esphome:
name: make-bed

esp8266:
board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
password: "removed"

wifi:
ssid: removed
password: removed

# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "removedt"
password: "removed"

captive_portal:

output:
- platform: gpio
id: 'IN1'
pin: D7
- platform: gpio
id: 'IN2'
pin: D6
- platform: gpio
id: 'IN3'
pin: D5
- platform: gpio
id: 'IN4'
pin: D1

binary_sensor:
- platform: gpio
pin: D4
name: "Raise Bed Toggle Switch"
on_press:
then:
- switch.toggle: make_bed

- platform: gpio
pin: D3
name: "Lower Bed Toggle Switch"
on_press:
then:
- switch.toggle: lower_bed



switch:
- platform: output
name: "IN_1"
output: 'IN1'
inverted: true
id: INS1
- platform: output
name: "IN_2"
output: 'IN2'
inverted: true
id: INS2
- platform: output
output: 'IN3'
name: "IN_3"
inverted: true
id: INS3
- platform: output
output: 'IN4'
name: "IN_4"
inverted: true
id: INS4

- platform: template
name: "Make Bed"
id: make_bed
turn_on_action:
- then:
- switch.turn_on: INS1
- switch.turn_on: INS2
- delay: 120s
- switch.turn_off: INS1
- switch.turn_off: INS2
- switch.template.publish:
id: make_bed
state: OFF
- platform: template
name: "Lower Bed"
id: lower_bed
turn_on_action:
- then:
- switch.turn_on: INS3
- switch.turn_on: INS4
- delay: 120s
- switch.turn_off: INS3
- switch.turn_off: INS4
- switch.template.publish:
id: make_bed
state: OFF

What I have found is that I toggle one of the sets of relays and nothing happens, I use one of the Binary switches and nothing.
I removed the relays and wired a single toggle switch to both the raise switchs and lower switches of the controls ( so one toggle switch to the two control switches ) and this caused both units to raise but the limit switch failed and the lower toggle switch would not wok.
Hoping someone can help me with how to get this to work, I am trying to have both jacks raise via home assist or a binory switch and have the switch turn off after two minutes.
As far as I can fathom, I have a issue with the switchs on the main jack controllers, these are a 4 prong PCB push button switch and I have soldered a wire onto two of the legs to bridge the switch between the two pins that only conect when you push the button and wired these wires into the relays.
Any help or guidance would be much appreciated.
Cheers in advance
Dave
 

Ralston18

Titan
Moderator
Two (possibly three) concerns:

1) "limit switch failed and 2) the lower toggle switch would not wok. "

and

3) "I have a issue with the switchs on the main jack controllers "

The starting point in my mind is to independently verify that each switch is indeed working correctly.

In general your code is understandable.

That said, l suggest that you also add an electrical schematic to your post showing all of components (switches, sensors, jacks, etc.) and the connections between them.

Make it possible to "walk through" what should happen when you press the applicable controller buttons.

= = = =

Nice project: my folks lived in a camper for many years and that is the sort of project my Dad would have enjoyed tinkering with.

Are those drawer slides being used for the vertical movement?
 
Jan 23, 2022
2
0
10
0
Hi and thanks for the response, yes the slide runners are for vertical support to stop and sideways sway when the couch is raising or lowering, this works really well and as they are a heavy duty runner they have no problem with the weight.

I think I have sorted the issue, turns out a solid state relay allows a trickle of current through even when in the off state, this was activating the switches all at the same time which turns out to do very weird things to the system.

I have replaced the solid state relays with normal no / NC relays and the whole thing is working as it should.

Thanks for you help with this.

Cheers

Dave
 

ASK THE COMMUNITY