Coder Social home page Coder Social logo

ssh's People

Contributors

ejonesnospam avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

ssh's Issues

Log Error - 'NoneType' object is not callable

Issue Summary

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 Details

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

Thoughts/Mumblings

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.

Log detail, primary issue, connection for 'turn on' action (similar error for 'turn off' action):

Example 1)

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>>}

Example 2)

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>>}

Log detail, non-issue, connection for 'update' action:

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

Multiple instances

When i create more than one sensor it fails out stating the following it sshsensor has no __attribute.

Command respond with command itself

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.