The trigger will happen at the point the value changes from 40 to below 40 and stays there for an hour.
If you started your test and it was already below 40, it will not trigger.
Also if you are starting out troubleshooting YAML outside of the AI entities and stated are recommended. Devices were build for the UI and are more difficult for people to manage and work with dur to the naming and other issues. Its not impossible, but a huge PIA.