Oh, great. I’ll try this.
-
New plugin [pimatic-onkyo-avr]
-
So, thinking a bit more about the rules, I think it would be nice to support all the by Pimatic provided AVR related actions, and for those other commands maybe something like:
when <something> then send "<command>" to OnkyoAVR
-
Well, I refactored the plugin and was able to merge sensor and device. But there is one problem now. I need the onkyoClient within the ActionHandler. The onkyoClient is created inside the device, but the ActionProvider is created by the plugin. Do you see a way to inject the onkyoClient into the ActionHandler?
-
I don’t think you need an OnkyoClient in the ActionProvider, you need an OnkyoDevice
Have a look overhere, where I, inspired by your use case, suggested, and included an implementation example, of an ActionProvider which would do what you want
-
Yes, I saw your request.
With my question I meant my code. --> https://github.com/saxn-paule/pimatic-onkyo-avr/blob/master/onkyo.coffee
I handle all the different commands - triggert by the action - within the ActionHandler. So I need to communicate with the AVR from the ActionHandler or need the connection created by the Device. -
I think you should move handling the commands to the Device, that’s much cleaner
-
Yes, but then I need the Device inside the ActionHandler to call a method like @device.handleCommands(cmd)
-
Exactly! Give me a moment and I will change some of your code and show you what I mean
-
Have a look:
https://github.com/rrooggiieerr/pimatic-onkyo-avr -
Great! It’s working. I’ll adjust the documentation, do some additional testing and will release a new version soon. Thank you very much.
-
version 0.1.0 released 2017-12-16
- avoid pimatic to crash on connection error
- moved sensor to device
- changed command syntax
-
I absolutely love your Onkyo/Pioneer-Plugin, it works perfect with my 2016 VSX-1131. Thank you so much for your work.
Just a quick question: What is preferred way to power on/off the receiver via pimatic? DummySwitch and rules? Or a button for every command?
-
I use ButtonDevices. Here is my old config I used with the pio-remote plugin: https://github.com/saxn-paule/pimatic-pio-remote/issues/5
-
Fine, thanks a lot
-
@saxnpaule said in New plugin [pimatic-onkyo-avr]:
version 0.1.0 released 2017-12-16
- avoid pimatic to crash on connection error
- moved sensor to device
- changed command syntax
I keep my Pioneer in standby-mode and your plugin still shows a lot of infos (IP, Volume, source, mute etc.) about my receiver. How can I see whether it is actually powered on or in standy mode? Would you be so kind and assist me to add the actual power status to the sensors of your plugin? The IP e.g. is not necessary, but the current power status would be really valuable for me…
-
You could send the POWER.STATUS command every x minutes and toggle a DummyPresenceSensor accordingly.
But nevertheless, I will try to add a variable for this, when I find the time.
-
@saxnpaule Thanks for your help, man. In the meantime I will try that DummySensor as a workaround.
-
version 0.1.1 released 2018-02-25
- provided power as variable
-
@saxnpaule Works perfect. Thank you so much!
-
Unfortunately, I cannot power on or off the receiver, but I have the following error in the logs:
error [pimatic]: An uncaught exception occurred: TypeError: this.log is not a function at Socket.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-onkyo-avr/lib/onkyo.js/onkyo.js:46:10) at emitTwo (events.js:87:13) at Socket.emit (events.js:172:7) at UDP.onMessage (dgram.js:506:8) This is most probably a bug in pimatic or in a module, please report it!
Can you help me?italicised text