sonoff-hack
sonoff-hack copied to clipboard
preset call not working
I just updated to 0.1.7, but I can't call presets from either HA or ODM. In HA I can't even call pan tilt commands
It could be a problem with the ptz binary.
Open a ssh session and try to move the cam manually:
/mnt/mmc/sonoff-hack/bin/ptz -a left -t 500
If it doesn't work, try ptz_h and ptz_p binaries.
the original ptz bin works through ssh but not for presets, I tried resetting them to the default hack and the same behavior persists, ODM is able to pan/tilt but not call or set presets, HA can't control any ptz aspect. When I try to set presets in ODM it returns "Too many presets"
Can confirm the issue. On 0.1.6 ptz from HA works well. But on 0.1.7 i get error calling procedure error. From ssh and web interface - works well
In the last release (0.1.7) I completely changed the onvif server.
There is a problem with the configuration file onvif_simple_server.conf Please use the files from this archive: sonoff-hack.tar.gz Let me know if it works.
Seems that nothing changed
Too many preset is a strange message. Please, post your /mnt/mmc/sonoff-hack/etc/ptz_presets.conf
there are few pretest, seems that onvif command is unable to access this file, at ODM the presets aren't lieted either
my ptz_presets.conf
0=0|969|956 1=1|2362|424 2=2|433|344 3=empty|-1|-1 4=empty|-1|-1 5=empty|-1|-1 6=empty|-1|-1 7=empty|-1|-1 8=empty|-1|-1 9=empty|-1|-1 ~
Could you post the output of the list command?
/mnt/mmc/sonoff-hack/bin/ptz -f /mnt/mmc/sonoff-hack/etc/ptz_presets.conf -a get_presets
This command just returned the usage guide, I tried ptz_h and it returned all presets, the ptz_p " can't load library 'libptz.so'" I renamed the ptz_h to ptz, it solved the problem at ODM, BUT at HA the behavior persists. Can I control PTZ through mqtt?
How did you add the cam to ha? Are you using onvif standard or my integration?
Litle update about HA Previously the presets are 0, 1, etc. Now, the presets are PresetToken_0, PresetToken_1, etc. I'm using onvif standard, I didn't know you had your own integration LOL
Are presets working now?
This is my integration: https://github.com/roleoroleo/yi-hack_ha_integration
EDIT
Can I control PTZ through mqtt?
No, at the moment.
Now the presets are working, but the single PTZ is not, just like in the h60ga, maybe the commands are also different, previously I was using UP, DOWN, LEFT, RIGHT of the HA, I will try some variations. In mean time I'll try your integration either
So pan and tilt in ODM work and in ha don't work. Correct? Did you test all available pan and tilt in ODM? I mean continuous, absolute and relative?
But... I'm able to test it. I will let you know.
Presets are fine in both HA and ODM. I'll check variation of relative, absolute and continuous, never had to worry about it before LOL
I got ONVIF integration error after the update, so i removed ONVIF integration and tried to install default onvif integration and it can't connect to the camera - ONVIF: All connection attempts failed.
That's it! Previously we didn't need to set move_mode for single moves, now we need to. Presets solved, single moves solved.
Another little fix: onvif_simple_server.gz
But I noticed a problem with ptz service in ha. Ha doesn't ask to the cam the range of the pan and tilt movements. When ha sends the command uses the range 0.0 - 1.0, but the cam works in degrees (0 - 360 and 0 - 180). So the cam doesn't move properly. I think ha is not compliant.
Another little fix: onvif_simple_server.gz
But I noticed a problem with ptz service in ha. Ha doesn't ask to the cam the range of the pan and tilt movements. When ha sends the command uses the range 0.0 - 1.0, but the cam works in degrees (0 - 360 and 0 - 180). So the cam doesn't move properly. I think ha is not compliant.
They probably did it like this cause not all camera can pan 0-360 or tilt 0-180, so they implement as percentage. I don't know how onvif tells to implement
In the onvif ptz specification there are 5 methods:
- GetConfiguration(s)
- GetConfigurationOptions
- GetNode(s) that return the configuration of the cam. The client should call these methods and get the values of all parameters: pan, tilt, zoom, etc... Then shoud call other methods using these values.
If you try ODM, you will see this sequence.
I can't make ONVIF work on firmware 0.1.7. HA standart integration can't connect after update. YI-hack integration can't connect too. I roled back to 0.1.6 and HA standart integration connected, but YI-hack is not working.
Please, restart from scratch. Clean your sd card and install again the hack.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.