ejonesnospam / ssh Goto Github PK
View Code? Open in Web Editor NEWHome Assistant Component SSH - 'Switch' and 'Sensor' Entities
License: MIT License
Home Assistant Component SSH - 'Switch' and 'Sensor' Entities
License: MIT License
While no functional issue can be identified, an error in the home-assistant log can be observed each time the switch is command on or off. However, the 'update' function, which performs very similar actions to the turn on or off, creates no error in the log. The end result of the turn on/off commands is, in fact, observed at the remote machine, provided permissions allow the action.
Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
Async/thread issue?
What is being called that is not callable??
Return channel not closed properly?
---I've attempted alternative code options, with no success of eliminating error.
2019-10-01 15:57:03 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1861770352] Received {'type': 'call_service', 'domain': 'switch', 'service': 'turn_off', 'service_data': {'entity_id': 'switch.ssh_switch_1'}, 'id': 29}
2019-10-01 15:57:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_off, service_data=entity_id=switch.ssh_switch_1>
2019-10-01 15:57:03 DEBUG (MainThread) [paramiko.transport] [chan 28] Max packet in: 32768 bytes
2019-10-01 15:57:03 DEBUG (Thread-2) [paramiko.transport] [chan 28] Max packet out: 32768 bytes
2019-10-01 15:57:03 DEBUG (Thread-2) [paramiko.transport] Secsh channel 28 opened.
2019-10-01 15:57:03 DEBUG (Thread-2) [paramiko.transport] [chan 28] Sesch channel 28 request ok
2019-10-01 15:57:03 DEBUG (Thread-2) [paramiko.transport] [chan 28] EOF received (28)
2019-10-01 15:57:03 DEBUG (MainThread) [paramiko.transport] [chan 28] EOF sent (28)
2019-10-01 15:57:03 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
2019-10-01 15:57:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=switch.ssh_switch_1, old_state=<state switch.ssh_switch_1=on; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:55:57.008766+00:00>, new_state=<state switch.ssh_switch_1=off; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:57:03.572298+00:00>>
2019-10-01 15:57:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=group.all_switches, old_state=<state group.all_switches=on; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:55:57.149099+00:00>, new_state=<state group.all_switches=off; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:57:03.580348+00:00>>
2019-10-01 15:57:03 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1861770352] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=switch.ssh_switch_1, old_state=<state switch.ssh_switch_1=on; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:55:57.008766+00:00>, new_state=<state switch.ssh_switch_1=off; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:57:03.572298+00:00>>}
2019-10-01 15:57:03 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1861770352] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=group.all_switches, old_state=<state group.all_switches=on; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:55:57.149099+00:00>, new_state=<state group.all_switches=off; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:57:03.580348+00:00>>}
2019-10-01 15:59:03 DEBUG (SyncWorker_2) [paramiko.transport] [chan 32] Max packet in: 32768 bytes
2019-10-01 15:59:03 DEBUG (Thread-2) [paramiko.transport] [chan 32] Max packet out: 32768 bytes
2019-10-01 15:59:03 DEBUG (Thread-2) [paramiko.transport] Secsh channel 32 opened.
2019-10-01 15:59:03 DEBUG (Thread-2) [paramiko.transport] [chan 32] Sesch channel 32 request ok
2019-10-01 15:59:03 DEBUG (Thread-2) [paramiko.transport] [chan 32] EOF received (32)
2019-10-01 15:59:03 DEBUG (SyncWorker_2) [custom_components.ssh2.switch] off
2019-10-01 15:59:03 DEBUG (SyncWorker_2) [paramiko.transport] [chan 32] EOF sent (32)
2019-10-01 15:59:30 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1861226160] Received {'type': 'call_service', 'domain': 'switch', 'service': 'turn_on', 'service_data': {'entity_id': 'switch.ssh_switch_1'}, 'id': 27}
2019-10-01 15:59:30 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_data=entity_id=switch.ssh_switch_1>
2019-10-01 15:59:30 DEBUG (MainThread) [paramiko.transport] [chan 33] Max packet in: 32768 bytes
2019-10-01 15:59:30 DEBUG (Thread-2) [paramiko.transport] [chan 33] Max packet out: 32768 bytes
2019-10-01 15:59:30 DEBUG (Thread-2) [paramiko.transport] Secsh channel 33 opened.
2019-10-01 15:59:30 DEBUG (Thread-2) [paramiko.transport] [chan 33] Sesch channel 33 request ok
2019-10-01 15:59:30 DEBUG (Thread-2) [paramiko.transport] [chan 33] EOF received (33)
2019-10-01 15:59:30 DEBUG (MainThread) [paramiko.transport] [chan 33] EOF sent (33)
2019-10-01 15:59:30 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
2019-10-01 15:59:30 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=switch.ssh_switch_1, old_state=<state switch.ssh_switch_1=off; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:57:03.572298+00:00>, new_state=<state switch.ssh_switch_1=on; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:59:30.219765+00:00>>
2019-10-01 15:59:30 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=group.all_switches, old_state=<state group.all_switches=off; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:57:03.580348+00:00>, new_state=<state group.all_switches=on; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:59:30.240446+00:00>>
2019-10-01 15:59:30 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1861226160] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=switch.ssh_switch_1, old_state=<state switch.ssh_switch_1=off; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:57:03.572298+00:00>, new_state=<state switch.ssh_switch_1=on; friendly_name=SSH Switch 1, icon=mdi:folder-key-network @ 2019-10-01T22:59:30.219765+00:00>>}
2019-10-01 15:59:30 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1861226160] Sending {'id': 2, 'type': 'event', 'event': <Event state_changed[L]: entity_id=group.all_switches, old_state=<state group.all_switches=off; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:57:03.580348+00:00>, new_state=<state group.all_switches=on; entity_id=('switch.ssh_switch_1',), order=0, auto=True, friendly_name=all switches, hidden=True @ 2019-10-01T22:59:30.240446+00:00>>}
2019-10-01 15:46:08 DEBUG (SyncWorker_16) [paramiko.transport] [chan 5] Max packet in: 32768 bytes
2019-10-01 15:46:08 DEBUG (Thread-2) [paramiko.transport] [chan 5] Max packet out: 32768 bytes
2019-10-01 15:46:08 DEBUG (Thread-2) [paramiko.transport] Secsh channel 5 opened.
2019-10-01 15:46:08 DEBUG (Thread-2) [paramiko.transport] [chan 5] Sesch channel 5 request ok
2019-10-01 15:46:08 DEBUG (Thread-2) [paramiko.transport] [chan 5] EOF received (5)
2019-10-01 15:46:08 DEBUG (SyncWorker_16) [custom_components.ssh2.switch] off
Info:
Home Assistant 0.99.3
PYTHON_VERSION | 3.7.4
When i create more than one sensor it fails out stating the following it sshsensor has no __attribute.
If I add the sensor to check the second raspberry Pi Temperature like this:
- platform: ssh
host: my2ndraspberryip
name: "my second Raspberry"
username: my username
password: my password
command: 'cat /sys/class/thermal/thermal_zone0/temp'
unit_of_measurement: '°C'
value_template: '{{ value | multiply(0.001) | round(1)}}'
sensor respond on HA: cat /sys/class/thermal/thermal_zone0/temp 55991
So, 55991 is correct, but I can't read the value template and add the command.
Can you help me about that?
info:
Home Assistant 107.7 (docker)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.