I have coded extensively using Hubduino to create projects like:
interface to VELUX blinds
shower solenoid on/off
lights etc (of course!)
The latest project is an rfid sensors outside the garage that, if successful opens the door.
All the above is fine but what if like to do is be able to report/trigger an attempted access. I’ve tried doing this by creating a contact (but with nothing physically connected) and “forcing” it open/closed with recieveSmartString commands but the state doesn’t change in Hubitat.
I guess I’m really looking for a “virtual” switch/contact that has no physical presence.
Any thoughts on how to report that state of something that is purely software based rather than physical?
Instead of calling receiveSmartString (which simulates receiving a command from Hubitat), it sound like you may want to call sendSmartStringNow() instead. This will send a command to Hubitat. In your case, “switch1 on” or “switch1 off” would be appropriate (assuming this is the only “switch” device in your sketch.